https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
ComputeSimoHughesJ2PlasticityStress Class Referenceabstract

#include <ComputeSimoHughesJ2PlasticityStress.h>

Inheritance diagram for ComputeSimoHughesJ2PlasticityStress:
[legend]

Public Types

typedef DerivativeMaterialPropertyNameInterface::SymbolName SymbolName
 

Public Member Functions

 ComputeSimoHughesJ2PlasticityStress (const InputParameters &parameters)
 
virtual void initialSetup () override
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialProperty (const std::string &name)
 
const GenericMaterialProperty< U, is_ad > & getDefaultMaterialPropertyByName (const std::string &name)
 
void validateDerivativeMaterialPropertyBase (const std::string &base)
 
const MaterialPropertyName derivativePropertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName derivativePropertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName derivativePropertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName derivativePropertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
GenericMaterialProperty< U, is_ad > & declarePropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, const SymbolName &c1, unsigned int v2, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivative (const std::string &base, unsigned int v1, unsigned int v2=libMesh::invalid_uint, unsigned int v3=libMesh::invalid_uint)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< VariableName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const std::vector< SymbolName > &c)
 
const GenericMaterialProperty< U, is_ad > & getMaterialPropertyDerivativeByName (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2="", const SymbolName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateCoupling (const MaterialPropertyName &base, const std::vector< VariableName > &c, bool validate_aux=true)
 
void validateCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
void validateNonlinearCoupling (const MaterialPropertyName &base, const VariableName &c1="", const VariableName &c2="", const VariableName &c3="")
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyName (const MaterialPropertyName &base, const std::vector< SymbolName > &c) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameFirst (const MaterialPropertyName &base, const SymbolName &c1) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameSecond (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 
const MaterialPropertyName propertyNameThird (const MaterialPropertyName &base, const SymbolName &c1, const SymbolName &c2, const SymbolName &c3) const
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual void initQpStatefulProperties () override
 
virtual void computeQpPK1Stress () override
 
void returnMappingSolve (const GenericReal< is_ad > &effective_trial_stress, GenericReal< is_ad > &scalar, const ConsoleStream &console)
 Perform the return mapping iterations.
 
virtual GenericReal< is_ad > minimumPermissibleValue (const GenericReal< is_ad > &effective_trial_stress) const
 Compute the minimum permissible value of the scalar.
 
virtual GenericReal< is_ad > maximumPermissibleValue (const GenericReal< is_ad > &effective_trial_stress) const
 Compute the maximum permissible value of the scalar.
 
virtual GenericReal< is_ad > initialGuess (const GenericReal< is_ad > &)
 Compute an initial guess for the value of the scalar.
 
virtual GenericReal< is_ad > computeResidual (const GenericReal< is_ad > &, const GenericReal< is_ad > &)=0
 Compute the residual for a predicted value of the scalar.
 
virtual GenericReal< is_ad > computeDerivative (const GenericReal< is_ad > &, const GenericReal< is_ad > &)=0
 Compute the derivative of the residual as a function of the scalar variable.
 
virtual GenericChainedReal< is_ad > computeResidualAndDerivative (const GenericReal< is_ad > &, const GenericChainedReal< is_ad > &)
 Compute the residual and the derivative for a predicted value of the scalar.
 
virtual Real computeReferenceResidual (const GenericReal< is_ad > &effective_trial_stress, const GenericReal< is_ad > &scalar)=0
 Compute a reference quantity to be used for checking relative convergence.
 
virtual void preStep (const GenericReal< is_ad > &, const GenericReal< is_ad > &, const GenericReal< is_ad > &)
 This method is called before taking a step in the return mapping algorithm.
 
virtual void iterationFinalize (const GenericReal< is_ad > &)
 Finalize internal state variables for a model for a given iteration.
 
virtual void outputIterationSummary (std::stringstream *iter_output, const unsigned int total_it)
 Output summary information for the convergence history of the model.
 
virtual void outputIterationStep (std::stringstream *iter_output, const GenericReal< is_ad > &effective_trial_stress, const GenericReal< is_ad > &scalar, const Real reference_residual)
 Output information for a single iteration step to build the convergence history of the model.
 
bool converged (const GenericReal< is_ad > &residual, const Real reference)
 Check to see whether the residual is within the convergence limits.
 
virtual Real computeReferenceResidual (const Real &effective_trial_stress, const Real &scalar) override
 The return mapping residual and derivative.
 
virtual Real computeResidual (const Real &effective_trial_stress, const Real &scalar) override
 
virtual Real computeDerivative (const Real &effective_trial_stress, const Real &scalar) override
 
virtual void preStep (const Real &scalar_old, const Real &residual, const Real &jacobian) override
 

Protected Attributes

const MaterialPropertyName _elasticity_tensor_name
 
const MaterialProperty< RankFourTensor > & _elasticity_tensor
 
const MaterialProperty< RankTwoTensor > & _F_old
 
const std::string _ep_name
 
MaterialProperty< Real > & _ep
 
const MaterialProperty< Real > & _ep_old
 
MaterialProperty< RankTwoTensor > & _be
 
const MaterialProperty< RankTwoTensor > & _be_old
 
MaterialProperty< RankTwoTensor > & _Np
 
MaterialBase_flow_stress_material
 
const std::string _flow_stress_name
 
const MaterialProperty< Real > & _H
 
const MaterialProperty< Real > & _dH
 
const MaterialProperty< Real > & _d2H
 
bool _check_range
 Whether to check to see whether iterative solution is within admissible range, and set within that range if outside.
 
bool _line_search
 Whether to use line searches to improve convergence.
 
bool _bracket_solution
 Whether to save upper and lower bounds of root for scalar, and set solution to the midpoint between those bounds if outside them.
 

Private Types

enum class  InternalSolveOutput { NEVER , ON_ERROR , ALWAYS }
 
enum class  SolveState { SUCCESS , NAN_INF , EXCEEDED_ITERATIONS }
 

Private Member Functions

bool haveMaterialProperty (const std::string &prop_name)
 
std::vector< VariableName > buildVariableVector (const VariableName &c1, const VariableName &c2, const VariableName &c3)
 
void validateCouplingHelper (const MaterialPropertyName &base, const std::vector< VariableName > &c, const System &system, std::vector< VariableName > &missing)
 
bool isNotObjectVariable (const VariableName &name)
 
void computeResidualAndDerivativeHelper (const GenericReal< is_ad > &effective_trial_stress, const GenericReal< is_ad > &scalar)
 Helper function to compute and set the _residual and _derivative.
 
SolveState internalSolve (const GenericReal< is_ad > effective_trial_stress, GenericReal< is_ad > &scalar, std::stringstream *iter_output=nullptr)
 Method called from within this class to perform the actual return mappping iterations.
 
bool convergedAcceptable (const unsigned int it, const Real reference)
 Check to see whether the residual is within acceptable convergence limits.
 
void checkPermissibleRange (GenericReal< is_ad > &scalar, GenericReal< is_ad > &scalar_increment, const GenericReal< is_ad > &scalar_old, const GenericReal< is_ad > min_permissible_scalar, const GenericReal< is_ad > max_permissible_scalar, std::stringstream *iter_output)
 Check to see whether solution is within admissible range, and set it within that range if it is not.
 
void updateBounds (const GenericReal< is_ad > &scalar, const GenericReal< is_ad > &residual, const Real init_resid_sign, GenericReal< is_ad > &scalar_upper_bound, GenericReal< is_ad > &scalar_lower_bound, std::stringstream *iter_output)
 Update the upper and lower bounds of the root for the effective inelastic strain.
 

Private Attributes

FEProblemBase_dmi_fe_problem
 
enum SingleVariableReturnMappingSolutionTempl::InternalSolveOutput _internal_solve_output_on
 
const unsigned int _max_its
 Maximum number of return mapping iterations.
 
const bool _internal_solve_full_iteration_history
 Whether to output iteration information all the time (regardless of whether iterations converge)
 
Real _relative_tolerance
 Relative convergence tolerance.
 
Real _absolute_tolerance
 Absolute convergence tolerance.
 
Real _acceptable_multiplier
 Multiplier applied to relative and absolute tolerances for acceptable convergence.
 
const bool _ad_derivative
 
const std::size_t _num_resids
 Number of residuals to be stored in history.
 
std::vector< Real > _residual_history
 History of residuals used to check whether progress is still being made on decreasing the residual.
 
unsigned int _iteration
 iteration number
 
GenericReal< is_ad > _derivative
 Derivative of the residual.
 
const std::string _svrms_name
 MOOSE input name of the object performing the solve.
 
RankFourTensor _d_be_d_F
 Helper (dummy) variables for iteratively updating the consistant tangent during return mapping.
 
RankFourTensor _d_n_d_be
 
RankTwoTensor _d_deltaep_d_betr
 
RankTwoTensor _d_R_d_betr
 
RankTwoTensor _d_J_d_betr
 
GenericReal< is_ad > _initial_residual
 Residual values, kept as members to retain solver state for summary outputting.
 
GenericReal< is_ad > _residual
 

Detailed Description

Definition at line 20 of file ComputeSimoHughesJ2PlasticityStress.h.

Member Enumeration Documentation

◆ InternalSolveOutput

template<bool is_ad>
enum class SingleVariableReturnMappingSolutionTempl::InternalSolveOutput
strongprivateinherited

◆ SolveState

template<bool is_ad>
enum class SingleVariableReturnMappingSolutionTempl::SolveState
strongprivateinherited

Constructor & Destructor Documentation

◆ ComputeSimoHughesJ2PlasticityStress()

ComputeSimoHughesJ2PlasticityStress::ComputeSimoHughesJ2PlasticityStress ( const InputParameters parameters)

Definition at line 27 of file ComputeSimoHughesJ2PlasticityStress.C.

31 _elasticity_tensor_name(_base_name + getParam<MaterialPropertyName>("elasticity_tensor")),
32 _elasticity_tensor(getMaterialProperty<RankFourTensor>(_elasticity_tensor_name)),
33 _F_old(getMaterialPropertyOld<RankTwoTensor>(_base_name + "deformation_gradient")),
34 _ep_name(_base_name + "effective_plastic_strain"),
35 _ep(declareProperty<Real>(_ep_name)),
36 _ep_old(getMaterialPropertyOldByName<Real>(_ep_name)),
37 _be(declareProperty<RankTwoTensor>(_base_name +
38 "volume_preserving_elastic_left_cauchy_green_strain")),
39 _be_old(getMaterialPropertyOldByName<RankTwoTensor>(
40 _base_name + "volume_preserving_elastic_left_cauchy_green_strain")),
41 _Np(declareProperty<RankTwoTensor>(_base_name + "flow_direction")),
42 _flow_stress_material(nullptr),
43 _flow_stress_name(_base_name + "flow_stress"),
44 _H(getMaterialPropertyByName<Real>(_flow_stress_name)),
45 _dH(getDefaultMaterialPropertyByName<Real, false>(
47 _d2H(getDefaultMaterialPropertyByName<Real, false>(
49{
50}
SingleVariableReturnMappingSolutionTempl< false > SingleVariableReturnMappingSolution
const MaterialProperty< RankFourTensor > & _elasticity_tensor
const MaterialProperty< RankTwoTensor > & _F_old
const MaterialProperty< RankTwoTensor > & _be_old
const MaterialPropertyName derivativePropertyName(const MaterialPropertyName &base, const std::vector< SymbolName > &c) const

Member Function Documentation

◆ checkPermissibleRange()

template<bool is_ad>
void SingleVariableReturnMappingSolutionTempl< is_ad >::checkPermissibleRange ( GenericReal< is_ad > &  scalar,
GenericReal< is_ad > &  scalar_increment,
const GenericReal< is_ad > &  scalar_old,
const GenericReal< is_ad >  min_permissible_scalar,
const GenericReal< is_ad >  max_permissible_scalar,
std::stringstream *  iter_output 
)
privateinherited

Check to see whether solution is within admissible range, and set it within that range if it is not.

Parameters
scalarCurrent value of the inelastic strain increment
scalar_incrementIncremental change in scalar from the previous iteration
scalar_oldPrevious value of scalar
min_permissible_scalarMinimum permissible value of scalar
max_permissible_scalarMaximum permissible value of scalar
iter_outputOutput stream

Definition at line 361 of file SingleVariableReturnMappingSolution.C.

368{
369 if (scalar > max_permissible_scalar)
370 {
371 scalar_increment = (max_permissible_scalar - scalar_old) / 2.0;
372 scalar = scalar_old + scalar_increment;
373 if (iter_output)
374 *iter_output << "Scalar greater than maximum ("
375 << MetaPhysicL::raw_value(max_permissible_scalar)
376 << ") adjusted scalar=" << MetaPhysicL::raw_value(scalar)
377 << " scalar_increment=" << MetaPhysicL::raw_value(scalar_increment) << std::endl;
378 }
379 else if (scalar < min_permissible_scalar)
380 {
381 scalar_increment = (min_permissible_scalar - scalar_old) / 2.0;
382 scalar = scalar_old + scalar_increment;
383 if (iter_output)
384 *iter_output << "Scalar less than minimum (" << MetaPhysicL::raw_value(min_permissible_scalar)
385 << ") adjusted scalar=" << MetaPhysicL::raw_value(scalar)
386 << " scalar_increment=" << MetaPhysicL::raw_value(scalar_increment) << std::endl;
387 }
388}
auto raw_value(const Eigen::Map< T > &in)

◆ computeDerivative() [1/2]

template<bool is_ad>
virtual GenericReal< is_ad > SingleVariableReturnMappingSolutionTempl< is_ad >::computeDerivative ( const GenericReal< is_ad > &  ,
const GenericReal< is_ad > &   
)
protectedpure virtualinherited

Compute the derivative of the residual as a function of the scalar variable.

The residual should be in strain increment units for all models for consistency.

Parameters
effective_trial_stressEffective trial stress
scalarInelastic strain increment magnitude being solved for

Implemented in LAROMANCEStressUpdateBaseTempl< is_ad >, CombinedNonlinearHardeningPlasticityTempl< is_ad >, CompositePowerLawCreepStressUpdateTempl< is_ad >, IsotropicPlasticityStressUpdateTempl< is_ad >, PowerLawCreepStressUpdateTempl< is_ad >, and PowerLawCreepTestTempl< is_ad >.

◆ computeDerivative() [2/2]

Real ComputeSimoHughesJ2PlasticityStress::computeDerivative ( const Real &  effective_trial_stress,
const Real &  scalar 
)
overrideprotectedvirtual

Definition at line 167 of file ComputeSimoHughesJ2PlasticityStress.C.

169{
171
172 // Update the flow stress
173 _ep[_qp] = _ep_old[_qp] + scalar;
175
176 return -G * _be[_qp].trace() - _dH[_qp];
177}
virtual void computePropertiesAtQp(unsigned int qp)
T getIsotropicShearModulus(const RankFourTensorTempl< T > &elasticity_tensor)
Get the shear modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must be ...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real

◆ computeQpPK1Stress()

void ComputeSimoHughesJ2PlasticityStress::computeQpPK1Stress ( )
overrideprotectedvirtual

Definition at line 73 of file ComputeSimoHughesJ2PlasticityStress.C.

74{
75 usingTensorIndices(i, j, k, l, m);
78 const auto I = RankTwoTensor::Identity();
79 const auto Fit = _F[_qp].inverse().transpose();
80 const auto detJ = _F[_qp].det();
81
82 // Update configuration
83 RankTwoTensor f = _inv_df[_qp].inverse();
84 RankTwoTensor f_bar = f / std::cbrt(f.det());
85
86 // Elastic predictor
87 _be[_qp] = f_bar * _be_old[_qp] * f_bar.transpose();
88 RankTwoTensor s = G * _be[_qp].deviatoric();
89 _Np[_qp] = MooseUtils::absoluteFuzzyEqual(s.norm(), 0) ? std::sqrt(1. / 2.) * I
90 : std::sqrt(3. / 2.) * s / s.norm();
91 Real s_eff = s.doubleContraction(_Np[_qp]);
92
93 // Compute the derivative of the strain before return mapping
94 if (_fe_problem.currentlyComputingJacobian())
95 _d_be_d_F = _F_old[_qp].inverse().times<l, m, i, j, k, m>(
96 (I.times<i, k, j, l>(f_bar * _be_old[_qp].transpose()) +
97 I.times<j, k, i, l>(f_bar * _be_old[_qp])) /
98 std::cbrt(f.det()) -
99 2. / 3. * _be[_qp].times<i, j, l, k>(_inv_df[_qp]));
100
101 // Check for plastic loading and do return mapping
102 Real delta_ep = 0;
103 if (computeResidual(s_eff, 0) > 0)
104 {
105 // Initialize the derivative of the internal variable
106 if (_fe_problem.currentlyComputingJacobian())
107 {
108 _d_deltaep_d_betr.zero();
109 if (MooseUtils::absoluteFuzzyEqual(s.norm(), 0))
110 _d_n_d_be.zero();
111 else
112 _d_n_d_be = G / std::sqrt(6) / s.norm() *
113 (3 * I.times<i, k, j, l>(I) - 2 * _Np[_qp].times<i, j, k, l>(_Np[_qp]) -
114 I.times<i, j, k, l>(I));
115 }
116
117 returnMappingSolve(s_eff, delta_ep, _console);
118
119 // Correct the derivative of the strain after return mapping
120 if (_fe_problem.currentlyComputingJacobian())
121 _d_be_d_F -=
122 2. / 3. *
123 (_be[_qp].trace() * _Np[_qp].times<i, j, k, l>(_d_deltaep_d_betr) +
124 delta_ep * _Np[_qp].times<i, j, k, l>(I) + delta_ep * _be[_qp].trace() * _d_n_d_be) *
125 _d_be_d_F;
126 }
127
128 // Update intermediate and current configurations
129 _ep[_qp] = _ep_old[_qp] + delta_ep;
130 _be[_qp] -= 2. / 3. * delta_ep * _be[_qp].trace() * _Np[_qp];
131 s = G * _be[_qp].deviatoric();
132 RankTwoTensor tau = (K * (detJ * detJ - 1) / 2) * I + s;
133 _pk1_stress[_qp] = tau * Fit;
134
135 // Compute the consistent tangent, i.e. the derivative of the PK1 stress w.r.t. the deformation
136 // gradient.
137 if (_fe_problem.currentlyComputingJacobian())
138 {
139 RankFourTensor d_tau_d_F = K * detJ * detJ * I.times<i, j, k, l>(Fit) +
140 G * (_d_be_d_F - I.times<i, j, k, l>(I) * _d_be_d_F / 3);
141 _pk1_jacobian[_qp] = Fit.times<m, j, i, m, k, l>(d_tau_d_F) - Fit.times<k, j, i, l>(tau * Fit);
142 }
143}
Real f(Real x)
Test function for Brents method.
virtual Real computeResidual(const Real &effective_trial_stress, const Real &scalar) override
RankFourTensor _d_be_d_F
Helper (dummy) variables for iteratively updating the consistant tangent during return mapping.
RankFourTensorTempl< T > inverse() const
T doubleContraction(const RankTwoTensorTempl< T > &a) const
RankTwoTensorTempl< T > inverse() const
RankTwoTensorTempl< T > transpose() const
static RankTwoTensorTempl Identity()
void returnMappingSolve(const GenericReal< is_ad > &effective_trial_stress, GenericReal< is_ad > &scalar, const ConsoleStream &console)
Perform the return mapping iterations.
T getIsotropicBulkModulus(const RankFourTensorTempl< T > &elasticity_tensor)
Get the bulk modulus for an isotropic elasticity tensor param elasticity_tensor the tensor (must be i...

◆ computeReferenceResidual() [1/2]

template<bool is_ad>
virtual Real SingleVariableReturnMappingSolutionTempl< is_ad >::computeReferenceResidual ( const GenericReal< is_ad > &  effective_trial_stress,
const GenericReal< is_ad > &  scalar 
)
protectedpure virtualinherited

Compute a reference quantity to be used for checking relative convergence.

This should be in strain increment units for all models for consistency.

Parameters
effective_trial_stressEffective trial stress
scalarInelastic strain increment magnitude being solved for

Implemented in RadialReturnStressUpdateTempl< is_ad >.

◆ computeReferenceResidual() [2/2]

Real ComputeSimoHughesJ2PlasticityStress::computeReferenceResidual ( const Real &  effective_trial_stress,
const Real &  scalar 
)
overrideprotectedvirtual

The return mapping residual and derivative.

Definition at line 146 of file ComputeSimoHughesJ2PlasticityStress.C.

148{
150 return effective_trial_stress - G * scalar * _be[_qp].trace();
151}

◆ computeResidual() [1/2]

template<bool is_ad>
virtual GenericReal< is_ad > SingleVariableReturnMappingSolutionTempl< is_ad >::computeResidual ( const GenericReal< is_ad > &  ,
const GenericReal< is_ad > &   
)
protectedpure virtualinherited

Compute the residual for a predicted value of the scalar.

This residual should be in strain increment units for all models for consistency.

Parameters
effective_trial_stressEffective trial stress
scalarInelastic strain increment magnitude being solved for

Implemented in CombinedNonlinearHardeningPlasticityTempl< is_ad >, CompositePowerLawCreepStressUpdateTempl< is_ad >, IsotropicPlasticityStressUpdateTempl< is_ad >, LAROMANCEStressUpdateBaseTempl< is_ad >, PowerLawCreepStressUpdateTempl< is_ad >, and PowerLawCreepTestTempl< is_ad >.

◆ computeResidual() [2/2]

Real ComputeSimoHughesJ2PlasticityStress::computeResidual ( const Real &  effective_trial_stress,
const Real &  scalar 
)
overrideprotectedvirtual

Definition at line 154 of file ComputeSimoHughesJ2PlasticityStress.C.

156{
158
159 // Update the flow stress
160 _ep[_qp] = _ep_old[_qp] + scalar;
162
163 return effective_trial_stress - G * scalar * _be[_qp].trace() - _H[_qp];
164}

Referenced by computeQpPK1Stress().

◆ computeResidualAndDerivative()

template<bool is_ad>
virtual GenericChainedReal< is_ad > SingleVariableReturnMappingSolutionTempl< is_ad >::computeResidualAndDerivative ( const GenericReal< is_ad > &  ,
const GenericChainedReal< is_ad > &   
)
inlineprotectedvirtualinherited

Compute the residual and the derivative for a predicted value of the scalar.

This residual should be in strain increment units for all models for consistency.

Parameters
effective_trial_stressEffective trial stress
scalarInelastic strain increment magnitude being solved for

Reimplemented in CompositePowerLawCreepStressUpdateTempl< is_ad >, and PowerLawCreepStressUpdateTempl< is_ad >.

Definition at line 97 of file SingleVariableReturnMappingSolution.h.

99 {
100 mooseError("computeResidualAndDerivative has to be implemented if "
101 "automatic_differentiation_return_mapping = true.");
102 return 0;
103 };
void mooseError(Args &&... args)

◆ computeResidualAndDerivativeHelper()

template<bool is_ad>
void SingleVariableReturnMappingSolutionTempl< is_ad >::computeResidualAndDerivativeHelper ( const GenericReal< is_ad > &  effective_trial_stress,
const GenericReal< is_ad > &  scalar 
)
privateinherited

Helper function to compute and set the _residual and _derivative.

Definition at line 308 of file SingleVariableReturnMappingSolution.C.

310{
311 if (_ad_derivative)
312 {
313 GenericChainedReal<is_ad> residual_and_derivative =
314 computeResidualAndDerivative(effective_trial_stress, GenericChainedReal<is_ad>(scalar, 1));
315 _residual = residual_and_derivative.value();
316 _derivative = residual_and_derivative.derivatives();
317 }
318 else
319 {
320 _residual = computeResidual(effective_trial_stress, scalar);
321 _derivative = computeDerivative(effective_trial_stress, scalar);
322 }
323}
Moose::GenericType< ChainedReal, is_ad > GenericChainedReal
virtual GenericChainedReal< is_ad > computeResidualAndDerivative(const GenericReal< is_ad > &, const GenericChainedReal< is_ad > &)
Compute the residual and the derivative for a predicted value of the scalar.
virtual GenericReal< is_ad > computeDerivative(const GenericReal< is_ad > &, const GenericReal< is_ad > &)=0
Compute the derivative of the residual as a function of the scalar variable.
GenericReal< is_ad > _derivative
Derivative of the residual.
virtual GenericReal< is_ad > computeResidual(const GenericReal< is_ad > &, const GenericReal< is_ad > &)=0
Compute the residual for a predicted value of the scalar.

◆ converged()

template<bool is_ad>
bool SingleVariableReturnMappingSolutionTempl< is_ad >::converged ( const GenericReal< is_ad > &  residual,
const Real  reference 
)
protectedinherited

Check to see whether the residual is within the convergence limits.

Parameters
residualCurrent value of the residual
referenceCurrent value of the reference quantity
Returns
Whether the model converged

Definition at line 327 of file SingleVariableReturnMappingSolution.C.

329{
330 const Real residual = MetaPhysicL::raw_value(ad_residual);
331 return (std::abs(residual) <= _absolute_tolerance ||
332 std::abs(residual / reference) <= _relative_tolerance);
333}

◆ convergedAcceptable()

template<bool is_ad>
bool SingleVariableReturnMappingSolutionTempl< is_ad >::convergedAcceptable ( const unsigned int  it,
const Real  reference 
)
privateinherited

Check to see whether the residual is within acceptable convergence limits.

This will only return true if it has been determined that progress is no longer being made and that the residual is within the acceptable limits.

Parameters
residualCurrent iteration count
residualCurrent value of the residual
referenceCurrent value of the reference quantity
Returns
Whether the model converged

Definition at line 337 of file SingleVariableReturnMappingSolution.C.

339{
340 using std::abs;
341
342 // Require that we have at least done _num_resids evaluations before we allow for
343 // acceptable convergence
344 if (it < _num_resids)
345 return false;
346
347 // Check to see whether the residual has dropped by convergence_history_factor over
348 // the last _num_resids iterations. If it has (which means it's still making progress),
349 // don't consider it to be converged within the acceptable limits.
350 const Real convergence_history_factor = 10.0;
351 if (abs(_residual * convergence_history_factor) < abs(_residual_history[(it + 1) % _num_resids]))
352 return false;
353
354 // Now that it's determined that progress is not being made, treat it as converged if
355 // we're within the acceptable convergence limits
356 return converged(_residual / _acceptable_multiplier, reference);
357}
bool converged(const GenericReal< is_ad > &residual, const Real reference)
Check to see whether the residual is within the convergence limits.
const std::size_t _num_resids
Number of residuals to be stored in history.
Real _acceptable_multiplier
Multiplier applied to relative and absolute tolerances for acceptable convergence.
std::vector< Real > _residual_history
History of residuals used to check whether progress is still being made on decreasing the residual.
MetaPhysicL::DualNumber< V, D, asd > abs(const MetaPhysicL::DualNumber< V, D, asd > &a)

◆ initialGuess()

template<bool is_ad>
virtual GenericReal< is_ad > SingleVariableReturnMappingSolutionTempl< is_ad >::initialGuess ( const GenericReal< is_ad > &  )
inlineprotectedvirtualinherited

Compute an initial guess for the value of the scalar.

For some cases, an intellegent starting point can provide enhanced robustness in the Newton iterations. This is also an opportunity for classes that derive from this to perform initialization tasks.

Parameters
effective_trial_stressEffective trial stress

Reimplemented in PowerLawCreepTestTempl< is_ad >.

Definition at line 66 of file SingleVariableReturnMappingSolution.h.

67 {
68 return 0.0;
69 }

◆ initialSetup()

void ComputeSimoHughesJ2PlasticityStress::initialSetup ( )
overridevirtual

Definition at line 53 of file ComputeSimoHughesJ2PlasticityStress.C.

54{
56
57 _flow_stress_material = &getMaterial("flow_stress_material");
58
59 // Enforce isotropic elastic tensor
60 if (!hasGuaranteedMaterialProperty(_elasticity_tensor_name, Guarantee::ISOTROPIC))
61 mooseError("ComputeSimoHughesJ2PlasticityStress requires an isotropic elasticity tensor");
62}
virtual void initialSetup() override
Derive _large_kinematics from the strain calculator's LARGE_KINEMATICS guarantee.

◆ initQpStatefulProperties()

void ComputeSimoHughesJ2PlasticityStress::initQpStatefulProperties ( )
overrideprotectedvirtual

Definition at line 65 of file ComputeSimoHughesJ2PlasticityStress.C.

66{
68 _be[_qp].setToIdentity();
69 _ep[_qp] = 0;
70}
virtual void initQpStatefulProperties()

◆ internalSolve()

template<bool is_ad>
SingleVariableReturnMappingSolutionTempl< is_ad >::SolveState SingleVariableReturnMappingSolutionTempl< is_ad >::internalSolve ( const GenericReal< is_ad >  effective_trial_stress,
GenericReal< is_ad > &  scalar,
std::stringstream *  iter_output = nullptr 
)
privateinherited

Method called from within this class to perform the actual return mappping iterations.

Parameters
effective_trial_stressEffective trial stress
scalarInelastic strain increment magnitude being solved for
iter_outputOutput stream – if null, no output is produced
Returns
Whether the solution was successful

Definition at line 163 of file SingleVariableReturnMappingSolution.C.

167{
168 scalar = initialGuess(effective_trial_stress);
169 GenericReal<is_ad> scalar_old = scalar;
170 GenericReal<is_ad> scalar_increment = 0.0;
171 const GenericReal<is_ad> min_permissible_scalar = minimumPermissibleValue(effective_trial_stress);
172 const GenericReal<is_ad> max_permissible_scalar = maximumPermissibleValue(effective_trial_stress);
173 GenericReal<is_ad> scalar_upper_bound = max_permissible_scalar;
174 GenericReal<is_ad> scalar_lower_bound = min_permissible_scalar;
175 _iteration = 0;
176
177 computeResidualAndDerivativeHelper(effective_trial_stress, scalar);
179
180 GenericReal<is_ad> residual_old = _residual;
182 Real reference_residual = computeReferenceResidual(effective_trial_stress, scalar);
183
184 if (converged(_residual, reference_residual))
185 {
186 iterationFinalize(scalar);
187 outputIterationStep(iter_output, effective_trial_stress, scalar, reference_residual);
188 return SolveState::SUCCESS;
189 }
190
191 _residual_history.assign(_num_resids, std::numeric_limits<Real>::max());
193
194 while (_iteration < _max_its && !converged(_residual, reference_residual) &&
195 !convergedAcceptable(_iteration, reference_residual))
196 {
197 preStep(scalar_old, _residual, _derivative);
198
199 scalar_increment = -_residual / _derivative;
200 scalar = scalar_old + scalar_increment;
201
202 if (_check_range)
204 scalar_increment,
205 scalar_old,
206 min_permissible_scalar,
207 max_permissible_scalar,
208 iter_output);
209
210 computeResidualAndDerivativeHelper(effective_trial_stress, scalar);
211 reference_residual = computeReferenceResidual(effective_trial_stress, scalar);
212 iterationFinalize(scalar);
213
216 scalar, _residual, init_resid_sign, scalar_upper_bound, scalar_lower_bound, iter_output);
217
218 if (converged(_residual, reference_residual))
219 {
220 outputIterationStep(iter_output, effective_trial_stress, scalar, reference_residual);
221 break;
222 }
223 else
224 {
225 bool modified_increment = false;
226
227 // Line Search
228 if (_line_search)
229 {
230 if (residual_old - _residual != 0.0)
231 {
232 GenericReal<is_ad> alpha = residual_old / (residual_old - _residual);
233 alpha = MathUtils::clamp(alpha, 1.0e-2, 1.0);
234
235 if (alpha != 1.0)
236 {
237 modified_increment = true;
238 scalar_increment *= alpha;
239 if (iter_output)
240 *iter_output << " Line search alpha = " << MetaPhysicL::raw_value(alpha)
241 << " increment = " << MetaPhysicL::raw_value(scalar_increment)
242 << std::endl;
243 }
244 }
245 }
246
248 {
249 // Check to see whether trial scalar_increment is outside the bounds, and set it to a point
250 // within the bounds if it is
251 if (scalar_old + scalar_increment >= scalar_upper_bound ||
252 scalar_old + scalar_increment <= scalar_lower_bound)
253 {
254 if (scalar_upper_bound != max_permissible_scalar &&
255 scalar_lower_bound != min_permissible_scalar)
256 {
257 const Real frac = 0.5;
258 scalar_increment =
259 (1.0 - frac) * scalar_lower_bound + frac * scalar_upper_bound - scalar_old;
260 modified_increment = true;
261 if (iter_output)
262 *iter_output << " Trial scalar_increment exceeded bounds. Setting between "
263 "lower/upper bounds. frac: "
264 << frac << std::endl;
265 }
266 }
267 }
268
269 // Update the trial scalar and recompute residual if the line search or bounds checking
270 // modified the increment
271 if (modified_increment)
272 {
273 scalar = scalar_old + scalar_increment;
274 computeResidualAndDerivativeHelper(effective_trial_stress, scalar);
275 reference_residual = computeReferenceResidual(effective_trial_stress, scalar);
276 iterationFinalize(scalar);
277
279 updateBounds(scalar,
280 _residual,
281 init_resid_sign,
282 scalar_upper_bound,
283 scalar_lower_bound,
284 iter_output);
285 }
286 }
287
288 outputIterationStep(iter_output, effective_trial_stress, scalar, reference_residual);
289
290 ++_iteration;
291 residual_old = _residual;
292 scalar_old = scalar;
294 }
295
296 using std::isnan, std::isinf;
298 return SolveState::NAN_INF;
299
300 if (_iteration == _max_its)
302
303 return SolveState::SUCCESS;
304}
Moose::GenericType< Real, is_ad > GenericReal
GenericReal< is_ad > _initial_residual
Residual values, kept as members to retain solver state for summary outputting.
bool _check_range
Whether to check to see whether iterative solution is within admissible range, and set within that ra...
bool convergedAcceptable(const unsigned int it, const Real reference)
Check to see whether the residual is within acceptable convergence limits.
virtual void preStep(const GenericReal< is_ad > &, const GenericReal< is_ad > &, const GenericReal< is_ad > &)
This method is called before taking a step in the return mapping algorithm.
void computeResidualAndDerivativeHelper(const GenericReal< is_ad > &effective_trial_stress, const GenericReal< is_ad > &scalar)
Helper function to compute and set the _residual and _derivative.
void updateBounds(const GenericReal< is_ad > &scalar, const GenericReal< is_ad > &residual, const Real init_resid_sign, GenericReal< is_ad > &scalar_upper_bound, GenericReal< is_ad > &scalar_lower_bound, std::stringstream *iter_output)
Update the upper and lower bounds of the root for the effective inelastic strain.
bool _bracket_solution
Whether to save upper and lower bounds of root for scalar, and set solution to the midpoint between t...
virtual GenericReal< is_ad > minimumPermissibleValue(const GenericReal< is_ad > &effective_trial_stress) const
Compute the minimum permissible value of the scalar.
const unsigned int _max_its
Maximum number of return mapping iterations.
virtual void iterationFinalize(const GenericReal< is_ad > &)
Finalize internal state variables for a model for a given iteration.
virtual void outputIterationStep(std::stringstream *iter_output, const GenericReal< is_ad > &effective_trial_stress, const GenericReal< is_ad > &scalar, const Real reference_residual)
Output information for a single iteration step to build the convergence history of the model.
bool _line_search
Whether to use line searches to improve convergence.
void checkPermissibleRange(GenericReal< is_ad > &scalar, GenericReal< is_ad > &scalar_increment, const GenericReal< is_ad > &scalar_old, const GenericReal< is_ad > min_permissible_scalar, const GenericReal< is_ad > max_permissible_scalar, std::stringstream *iter_output)
Check to see whether solution is within admissible range, and set it within that range if it is not.
virtual Real computeReferenceResidual(const GenericReal< is_ad > &effective_trial_stress, const GenericReal< is_ad > &scalar)=0
Compute a reference quantity to be used for checking relative convergence.
virtual GenericReal< is_ad > initialGuess(const GenericReal< is_ad > &)
Compute an initial guess for the value of the scalar.
virtual GenericReal< is_ad > maximumPermissibleValue(const GenericReal< is_ad > &effective_trial_stress) const
Compute the maximum permissible value of the scalar.
T sign(T x)
T clamp(const T &x, T2 lowerlimit, T2 upperlimit)
bool isnan(std::complex< T > a)
bool isinf(std::complex< T > a)

◆ iterationFinalize()

template<bool is_ad>
virtual void SingleVariableReturnMappingSolutionTempl< is_ad >::iterationFinalize ( const GenericReal< is_ad > &  )
inlineprotectedvirtualinherited

Finalize internal state variables for a model for a given iteration.

Parameters
scalarInelastic strain increment magnitude being solved for

Reimplemented in CombinedNonlinearHardeningPlasticityTempl< is_ad >, and IsotropicPlasticityStressUpdateTempl< is_ad >.

Definition at line 128 of file SingleVariableReturnMappingSolution.h.

128{}

◆ maximumPermissibleValue()

template<bool is_ad>
GenericReal< is_ad > SingleVariableReturnMappingSolutionTempl< is_ad >::maximumPermissibleValue ( const GenericReal< is_ad > &  effective_trial_stress) const
protectedvirtualinherited

Compute the maximum permissible value of the scalar.

For some models, the magnitude of this may be known.

Parameters
effective_trial_stressEffective trial stress

Reimplemented in PowerLawCreepTestTempl< is_ad >, LAROMANCEStressUpdateBaseTempl< is_ad >, and RadialReturnStressUpdateTempl< is_ad >.

Definition at line 92 of file SingleVariableReturnMappingSolution.C.

94{
95 return std::numeric_limits<Real>::max();
96}

◆ minimumPermissibleValue()

template<bool is_ad>
GenericReal< is_ad > SingleVariableReturnMappingSolutionTempl< is_ad >::minimumPermissibleValue ( const GenericReal< is_ad > &  effective_trial_stress) const
protectedvirtualinherited

Compute the minimum permissible value of the scalar.

For some models, the magnitude of this may be known.

Parameters
effective_trial_stressEffective trial stress

Reimplemented in RadialReturnStressUpdateTempl< is_ad >, and PowerLawCreepTestTempl< is_ad >.

Definition at line 84 of file SingleVariableReturnMappingSolution.C.

86{
87 return std::numeric_limits<Real>::lowest();
88}

◆ outputIterationStep()

template<bool is_ad>
void SingleVariableReturnMappingSolutionTempl< is_ad >::outputIterationStep ( std::stringstream *  iter_output,
const GenericReal< is_ad > &  effective_trial_stress,
const GenericReal< is_ad > &  scalar,
const Real  reference_residual 
)
protectedvirtualinherited

Output information for a single iteration step to build the convergence history of the model.

Parameters
iter_outputOutput stream
effective_trial_stressEffective trial stress
residualCurrent value of the residual
referenceCurrent value of the reference quantity

Reimplemented in LAROMANCEStressUpdateBaseTempl< is_ad >.

Definition at line 421 of file SingleVariableReturnMappingSolution.C.

426{
427 if (iter_output)
428 {
429 const unsigned int it = _iteration;
430 const Real residual = MetaPhysicL::raw_value(_residual);
431
432 *iter_output << " iteration=" << it
433 << " trial_stress=" << MetaPhysicL::raw_value(effective_trial_stress)
434 << " scalar=" << MetaPhysicL::raw_value(scalar) << " residual=" << residual
435 << " ref_res=" << reference_residual
436 << " rel_res=" << std::abs(residual) / reference_residual
437 << " rel_tol=" << _relative_tolerance << " abs_res=" << std::abs(residual)
438 << " abs_tol=" << _absolute_tolerance << '\n';
439 }
440}

Referenced by LAROMANCEStressUpdateBaseTempl< is_ad >::outputIterationStep().

◆ outputIterationSummary()

template<bool is_ad>
void SingleVariableReturnMappingSolutionTempl< is_ad >::outputIterationSummary ( std::stringstream *  iter_output,
const unsigned int  total_it 
)
protectedvirtualinherited

Output summary information for the convergence history of the model.

Parameters
iter_outputOutput stream
total_itTotal iteration count

Reimplemented in ADViscoplasticityStressUpdate, LAROMANCEStressUpdateBaseTempl< is_ad >, and RadialReturnStressUpdateTempl< is_ad >.

Definition at line 444 of file SingleVariableReturnMappingSolution.C.

446{
447 if (iter_output)
448 *iter_output << "In " << total_it << " iterations the residual went from "
450 << MetaPhysicL::raw_value(_residual) << " in '" << _svrms_name << "'."
451 << std::endl;
452}
const std::string _svrms_name
MOOSE input name of the object performing the solve.

Referenced by ADViscoplasticityStressUpdate::outputIterationSummary(), LAROMANCEStressUpdateBaseTempl< is_ad >::outputIterationSummary(), and RadialReturnStressUpdateTempl< is_ad >::outputIterationSummary().

◆ preStep() [1/2]

template<bool is_ad>
virtual void SingleVariableReturnMappingSolutionTempl< is_ad >::preStep ( const GenericReal< is_ad > &  ,
const GenericReal< is_ad > &  ,
const GenericReal< is_ad > &   
)
inlineprotectedvirtualinherited

This method is called before taking a step in the return mapping algorithm.

A typical use case is to accumulate the exact algorithmic tangent during return mapping.

Definition at line 118 of file SingleVariableReturnMappingSolution.h.

121 {
122 }

◆ preStep() [2/2]

void ComputeSimoHughesJ2PlasticityStress::preStep ( const Real &  scalar_old,
const Real &  residual,
const Real &  jacobian 
)
overrideprotectedvirtual

Definition at line 180 of file ComputeSimoHughesJ2PlasticityStress.C.

181{
182 if (!_fe_problem.currentlyComputingJacobian())
183 return;
184
185 const auto I = RankTwoTensor::Identity();
187
188 // Update the flow stress
189 _ep[_qp] = _ep_old[_qp] + scalar;
191
193 G * _Np[_qp] - G * scalar * I - (G * _be[_qp].trace() + _dH[_qp]) * _d_deltaep_d_betr;
194 _d_J_d_betr = -G * I - _d2H[_qp] * _d_deltaep_d_betr;
195 _d_deltaep_d_betr += -1 / J * _d_R_d_betr + R / J / J * _d_J_d_betr;
196}
const double R

◆ returnMappingSolve()

template<bool is_ad>
void SingleVariableReturnMappingSolutionTempl< is_ad >::returnMappingSolve ( const GenericReal< is_ad > &  effective_trial_stress,
GenericReal< is_ad > &  scalar,
const ConsoleStream console 
)
protectedinherited

Perform the return mapping iterations.

Parameters
effective_trial_stressEffective trial stress
scalarInelastic strain increment magnitude being solved for
consoleConsole output

Definition at line 100 of file SingleVariableReturnMappingSolution.C.

104{
105 // construct the stringstream here only if the debug level is set to ALL
106 std::unique_ptr<std::stringstream> iter_output =
108 ? std::make_unique<std::stringstream>()
109 : nullptr;
110
111 // do the internal solve and capture iteration info during the first round
112 // iff full history output is requested regardless of whether the solve failed or succeeded
113 auto solve_state =
114 internalSolve(effective_trial_stress,
115 scalar,
116 _internal_solve_full_iteration_history ? iter_output.get() : nullptr);
117 if (solve_state != SolveState::SUCCESS &&
119 {
120 // output suppressed by user, throw immediately
122 mooseException("");
123
124 // user expects some kind of output, if necessary setup output stream now
125 if (!iter_output)
126 iter_output = std::make_unique<std::stringstream>();
127
128 // add the appropriate error message to the output
129 switch (solve_state)
130 {
132 *iter_output << "Encountered inf or nan in material return mapping iterations.\n";
133 break;
134
136 *iter_output << "Exceeded maximum iterations in material return mapping iterations.\n";
137 break;
138
139 default:
140 mooseError("Unhandled solver state");
141 }
142
143 // if full history output is only requested for failed solves we have to repeat
144 // the solve a second time
146 internalSolve(effective_trial_stress, scalar, iter_output.get());
147
148 // Append summary and throw exception
149 outputIterationSummary(iter_output.get(), _iteration);
150 mooseException(iter_output->str());
151 }
152
154 {
155 // the solve did not fail but the user requested debug output anyways
156 outputIterationSummary(iter_output.get(), _iteration);
157 console << iter_output->str() << std::flush;
158 }
159}
SolveState internalSolve(const GenericReal< is_ad > effective_trial_stress, GenericReal< is_ad > &scalar, std::stringstream *iter_output=nullptr)
Method called from within this class to perform the actual return mappping iterations.
const bool _internal_solve_full_iteration_history
Whether to output iteration information all the time (regardless of whether iterations converge)
virtual void outputIterationSummary(std::stringstream *iter_output, const unsigned int total_it)
Output summary information for the convergence history of the model.

Referenced by ADViscoplasticityStressUpdate::computeInelasticStrainIncrement(), and computeQpPK1Stress().

◆ updateBounds()

template<bool is_ad>
void SingleVariableReturnMappingSolutionTempl< is_ad >::updateBounds ( const GenericReal< is_ad > &  scalar,
const GenericReal< is_ad > &  residual,
const Real  init_resid_sign,
GenericReal< is_ad > &  scalar_upper_bound,
GenericReal< is_ad > &  scalar_lower_bound,
std::stringstream *  iter_output 
)
privateinherited

Update the upper and lower bounds of the root for the effective inelastic strain.

Parameters
scalarCurrent value of the inelastic strain increment
residualCurrent value of the residual
init_resid_signSign of the initial value of the residual
scalar_upper_boundUpper bound value of scalar
scalar_lower_boundLower bound value of scalar
iter_outputOutput stream

Definition at line 392 of file SingleVariableReturnMappingSolution.C.

399{
400 // Update upper/lower bounds as applicable
401 if (residual * init_resid_sign < 0.0 && scalar < scalar_upper_bound)
402 {
403 scalar_upper_bound = scalar;
404 if (scalar_upper_bound < scalar_lower_bound)
405 {
406 scalar_upper_bound = scalar_lower_bound;
407 scalar_lower_bound = 0.0;
408 if (iter_output)
409 *iter_output << " Corrected for scalar_upper_bound < scalar_lower_bound" << std::endl;
410 }
411 }
412 // Don't permit setting scalar_lower_bound > scalar_upper_bound (but do permit the reverse).
413 // This ensures that if we encounter multiple roots, we pick the lowest one.
414 else if (residual * init_resid_sign > 0.0 && scalar > scalar_lower_bound &&
415 scalar < scalar_upper_bound)
416 scalar_lower_bound = scalar;
417}

◆ validParams()

InputParameters ComputeSimoHughesJ2PlasticityStress::validParams ( )
static

Definition at line 15 of file ComputeSimoHughesJ2PlasticityStress.C.

16{
19 params.addClassDescription("The Simo-Hughes style J2 plasticity.");
20 params.addParam<MaterialPropertyName>(
21 "elasticity_tensor", "elasticity_tensor", "The name of the elasticity tensor.");
22 params.addRequiredParam<MaterialName>("flow_stress_material",
23 "The material defining the flow stress");
24 return params;
25}
void addRequiredParam(const std::string &name, const std::string &doc_string)
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)

Member Data Documentation

◆ _absolute_tolerance

template<bool is_ad>
Real SingleVariableReturnMappingSolutionTempl< is_ad >::_absolute_tolerance
privateinherited

Absolute convergence tolerance.

Definition at line 197 of file SingleVariableReturnMappingSolution.h.

◆ _acceptable_multiplier

template<bool is_ad>
Real SingleVariableReturnMappingSolutionTempl< is_ad >::_acceptable_multiplier
privateinherited

Multiplier applied to relative and absolute tolerances for acceptable convergence.

Definition at line 200 of file SingleVariableReturnMappingSolution.h.

◆ _ad_derivative

template<bool is_ad>
const bool SingleVariableReturnMappingSolutionTempl< is_ad >::_ad_derivative
privateinherited

Definition at line 205 of file SingleVariableReturnMappingSolution.h.

◆ _be

MaterialProperty<RankTwoTensor>& ComputeSimoHughesJ2PlasticityStress::_be
protected

◆ _be_old

const MaterialProperty<RankTwoTensor>& ComputeSimoHughesJ2PlasticityStress::_be_old
protected

Definition at line 53 of file ComputeSimoHughesJ2PlasticityStress.h.

Referenced by computeQpPK1Stress().

◆ _bracket_solution

template<bool is_ad>
bool SingleVariableReturnMappingSolutionTempl< is_ad >::_bracket_solution
protectedinherited

Whether to save upper and lower bounds of root for scalar, and set solution to the midpoint between those bounds if outside them.

Definition at line 145 of file SingleVariableReturnMappingSolution.h.

◆ _check_range

template<bool is_ad>
bool SingleVariableReturnMappingSolutionTempl< is_ad >::_check_range
protectedinherited

Whether to check to see whether iterative solution is within admissible range, and set within that range if outside.

Definition at line 138 of file SingleVariableReturnMappingSolution.h.

Referenced by ADViscoplasticityStressUpdate::ADViscoplasticityStressUpdate(), LAROMANCEStressUpdateBaseTempl< is_ad >::LAROMANCEStressUpdateBaseTempl(), and PowerLawCreepTestTempl< is_ad >::PowerLawCreepTestTempl().

◆ _d2H

const MaterialProperty<Real>& ComputeSimoHughesJ2PlasticityStress::_d2H
protected

Definition at line 60 of file ComputeSimoHughesJ2PlasticityStress.h.

Referenced by preStep().

◆ _d_be_d_F

RankFourTensor ComputeSimoHughesJ2PlasticityStress::_d_be_d_F
private

Helper (dummy) variables for iteratively updating the consistant tangent during return mapping.

Definition at line 64 of file ComputeSimoHughesJ2PlasticityStress.h.

Referenced by computeQpPK1Stress().

◆ _d_deltaep_d_betr

RankTwoTensor ComputeSimoHughesJ2PlasticityStress::_d_deltaep_d_betr
private

Definition at line 66 of file ComputeSimoHughesJ2PlasticityStress.h.

Referenced by computeQpPK1Stress(), and preStep().

◆ _d_J_d_betr

RankTwoTensor ComputeSimoHughesJ2PlasticityStress::_d_J_d_betr
private

Definition at line 68 of file ComputeSimoHughesJ2PlasticityStress.h.

Referenced by preStep().

◆ _d_n_d_be

RankFourTensor ComputeSimoHughesJ2PlasticityStress::_d_n_d_be
private

Definition at line 65 of file ComputeSimoHughesJ2PlasticityStress.h.

Referenced by computeQpPK1Stress().

◆ _d_R_d_betr

RankTwoTensor ComputeSimoHughesJ2PlasticityStress::_d_R_d_betr
private

Definition at line 67 of file ComputeSimoHughesJ2PlasticityStress.h.

Referenced by preStep().

◆ _derivative

template<bool is_ad>
GenericReal<is_ad> SingleVariableReturnMappingSolutionTempl< is_ad >::_derivative
privateinherited

Derivative of the residual.

Definition at line 222 of file SingleVariableReturnMappingSolution.h.

◆ _dH

const MaterialProperty<Real>& ComputeSimoHughesJ2PlasticityStress::_dH
protected

Definition at line 59 of file ComputeSimoHughesJ2PlasticityStress.h.

Referenced by computeDerivative(), and preStep().

◆ _elasticity_tensor

const MaterialProperty<RankFourTensor>& ComputeSimoHughesJ2PlasticityStress::_elasticity_tensor
protected

◆ _elasticity_tensor_name

const MaterialPropertyName ComputeSimoHughesJ2PlasticityStress::_elasticity_tensor_name
protected

Definition at line 45 of file ComputeSimoHughesJ2PlasticityStress.h.

Referenced by initialSetup().

◆ _ep

MaterialProperty<Real>& ComputeSimoHughesJ2PlasticityStress::_ep
protected

◆ _ep_name

const std::string ComputeSimoHughesJ2PlasticityStress::_ep_name
protected

◆ _ep_old

const MaterialProperty<Real>& ComputeSimoHughesJ2PlasticityStress::_ep_old
protected

◆ _F_old

const MaterialProperty<RankTwoTensor>& ComputeSimoHughesJ2PlasticityStress::_F_old
protected

Definition at line 48 of file ComputeSimoHughesJ2PlasticityStress.h.

Referenced by computeQpPK1Stress().

◆ _flow_stress_material

MaterialBase* ComputeSimoHughesJ2PlasticityStress::_flow_stress_material
protected

◆ _flow_stress_name

const std::string ComputeSimoHughesJ2PlasticityStress::_flow_stress_name
protected

Definition at line 57 of file ComputeSimoHughesJ2PlasticityStress.h.

◆ _H

const MaterialProperty<Real>& ComputeSimoHughesJ2PlasticityStress::_H
protected

Definition at line 58 of file ComputeSimoHughesJ2PlasticityStress.h.

Referenced by computeResidual().

◆ _initial_residual

template<bool is_ad>
GenericReal<is_ad> SingleVariableReturnMappingSolutionTempl< is_ad >::_initial_residual
privateinherited

Residual values, kept as members to retain solver state for summary outputting.

Definition at line 217 of file SingleVariableReturnMappingSolution.h.

◆ _internal_solve_full_iteration_history

template<bool is_ad>
const bool SingleVariableReturnMappingSolutionTempl< is_ad >::_internal_solve_full_iteration_history
privateinherited

Whether to output iteration information all the time (regardless of whether iterations converge)

Definition at line 191 of file SingleVariableReturnMappingSolution.h.

◆ _internal_solve_output_on

template<bool is_ad>
enum SingleVariableReturnMappingSolutionTempl::InternalSolveOutput SingleVariableReturnMappingSolutionTempl< is_ad >::_internal_solve_output_on
privateinherited

◆ _iteration

template<bool is_ad>
unsigned int SingleVariableReturnMappingSolutionTempl< is_ad >::_iteration
privateinherited

iteration number

Definition at line 214 of file SingleVariableReturnMappingSolution.h.

◆ _line_search

template<bool is_ad>
bool SingleVariableReturnMappingSolutionTempl< is_ad >::_line_search
protectedinherited

Whether to use line searches to improve convergence.

Definition at line 141 of file SingleVariableReturnMappingSolution.h.

◆ _max_its

template<bool is_ad>
const unsigned int SingleVariableReturnMappingSolutionTempl< is_ad >::_max_its
privateinherited

Maximum number of return mapping iterations.

This exists only to avoid an infinite loop, and is is intended to be a large number that is not settable by the user.

Definition at line 188 of file SingleVariableReturnMappingSolution.h.

◆ _Np

MaterialProperty<RankTwoTensor>& ComputeSimoHughesJ2PlasticityStress::_Np
protected

Definition at line 54 of file ComputeSimoHughesJ2PlasticityStress.h.

Referenced by computeQpPK1Stress(), and preStep().

◆ _num_resids

template<bool is_ad>
const std::size_t SingleVariableReturnMappingSolutionTempl< is_ad >::_num_resids
privateinherited

Number of residuals to be stored in history.

Definition at line 208 of file SingleVariableReturnMappingSolution.h.

◆ _relative_tolerance

template<bool is_ad>
Real SingleVariableReturnMappingSolutionTempl< is_ad >::_relative_tolerance
privateinherited

Relative convergence tolerance.

Definition at line 194 of file SingleVariableReturnMappingSolution.h.

◆ _residual

template<bool is_ad>
GenericReal<is_ad> SingleVariableReturnMappingSolutionTempl< is_ad >::_residual
privateinherited

Definition at line 218 of file SingleVariableReturnMappingSolution.h.

◆ _residual_history

template<bool is_ad>
std::vector<Real> SingleVariableReturnMappingSolutionTempl< is_ad >::_residual_history
privateinherited

History of residuals used to check whether progress is still being made on decreasing the residual.

Definition at line 211 of file SingleVariableReturnMappingSolution.h.

◆ _svrms_name

template<bool is_ad>
const std::string SingleVariableReturnMappingSolutionTempl< is_ad >::_svrms_name
privateinherited

MOOSE input name of the object performing the solve.

Definition at line 225 of file SingleVariableReturnMappingSolution.h.


The documentation for this class was generated from the following files: