https://mooseframework.inl.gov
ComputeLagrangianStressBase.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 {
16 
17  params.addDeprecatedParam<bool>(
18  "large_kinematics",
19  false,
20  "Use a large displacement stress update.",
21  "large_kinematics is no longer set on the stress calculator; it is derived from the "
22  "ComputeLagrangianStrain calculator (the single source of truth) via the LARGE_KINEMATICS "
23  "guarantee. Remove it here and set it only on the strain calculator.");
24 
25  params.addParam<std::string>("base_name", "Material property base name");
26 
27  return params;
28 }
29 
31  : Material(parameters),
32  GuaranteeConsumer(this),
33  // Derived from the strain calculator's guarantee in initialSetup(); the local parameter is
34  // deprecated and only consulted for a consistency cross-check.
35  _large_kinematics(false),
36  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
37  _cauchy_stress(declareProperty<RankTwoTensor>(_base_name + "cauchy_stress")),
38  _cauchy_jacobian(declareProperty<RankFourTensor>(_base_name + "cauchy_jacobian")),
39  _pk1_stress(declareProperty<RankTwoTensor>(_base_name + "pk1_stress")),
40  _pk1_jacobian(declareProperty<RankFourTensor>(_base_name + "pk1_jacobian")),
41  _pk1_jacobian_bypass_fbar(
42  declareProperty<RankFourTensor>(_base_name + "pk1_jacobian_bypass_fbar")),
43  _dpk1_d_grad_u(declareProperty<RankFourTensor>(_base_name + "dpk1_d_grad_u")),
44  _d_F_d_grad_u(getMaterialPropertyByName<RankFourTensor>(
45  _base_name + "d_deformation_gradient_d_grad_displacement")),
46  _F_ust(
47  getMaterialPropertyByName<RankTwoTensor>(_base_name + "unstabilized_deformation_gradient")),
48  _d_deformation_gradient_increment_d_F(getMaterialPropertyByName<RankFourTensor>(
49  _base_name + "d_spatial_deformation_gradient_increment_d_deformation_gradient")),
50  _d_F_stab_d_F_ust(
51  getMaterialPropertyByName<RankFourTensor>(_base_name + "d_F_stab_d_F_unstabilized")),
52  _d_F_stab_d_F_avg(
53  getMaterialPropertyByName<RankFourTensor>(_base_name + "d_F_stab_d_F_average")),
54  _d_nl_fbar(declareProperty<RankFourTensor>(_base_name + "d_nl_fbar_operator"))
55 {
56 }
57 
58 void
60 {
62 
63  // Derive the kinematics regime from the strain calculator's LARGE_KINEMATICS guarantee -- the
64  // single source of truth. Block-restricted (per subdomain) and keyed by the base_name-prefixed
65  // deformation_gradient (so a given base_name matches its own strain calculator).
68 
69  // The deprecated local parameter must not silently disagree with the strain calculator.
70  if (isParamSetByUser("large_kinematics") &&
71  getParam<bool>("large_kinematics") != _large_kinematics)
72  paramError("large_kinematics",
73  "large_kinematics disagrees with the ComputeLagrangianStrain calculator (which "
74  "computes ",
75  _large_kinematics ? "large" : "small",
76  " kinematics). large_kinematics is deprecated here; set it only on the strain "
77  "calculator.");
78 }
79 
80 void
82 {
83  // Actually no need to zero out the stresses as they aren't stateful (yet)
84 }
85 
86 void
88 {
90  // Chain the kinematic policy into the PK1 Jacobian so the TL kernel consumes a single
91  // d(PK1)/d(grad u) property and doesn't need to know about the generalized-alpha weighting.
92  // For alpha = 1 (default) this is _pk1_jacobian itself. These are read only during Jacobian
93  // assembly, so skip the R4*R4 work on residual-only sweeps.
96  {
98 
99  // Non-local F-bar operator, composed once per qp here (shared by all displacement kernels)
100  // instead of per-kernel in the assembly precalculate. `isPropertyActive`-gated so only the
101  // F-bar (stabilized) kernels pay for the R4*R4*R4 chain.
105  }
106 }
FEProblemBase & _fe_problem
void addDeprecatedParam(const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
MaterialProperty< RankFourTensor > & _dpk1_d_grad_u
The derivative of the 1st PK stress wrt the displacement gradient (grad u_{n+1}). ...
void paramError(const std::string &param, Args... args) const
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
bool _large_kinematics
If true use large deformations.
const MaterialProperty< RankFourTensor > & _d_F_stab_d_F_avg
d(F_stab)/d(F_avg), the non-local F-bar partial. Read to compose _d_nl_fbar.
const bool & currentlyComputingResidualAndJacobian() const
virtual void initialSetup() override
Derive _large_kinematics from the strain calculator&#39;s LARGE_KINEMATICS guarantee. ...
const std::string _base_name
Prepend to the material properties.
unsigned int _qp
MaterialProperty< RankFourTensor > & _d_nl_fbar
Non-local F-bar operator D_nl = cauchy_jacobian : d(dL)/dF : d(F_stab)/d(F_avg), published so the Lag...
virtual void initQpStatefulProperties() override
Initialize everything with zeros.
MaterialProperty< RankFourTensor > & _pk1_jacobian
The derivative of the 1st PK stress wrt the deformation gradient (F that the stress material consumes...
static InputParameters validParams()
const MaterialProperty< RankFourTensor > & _d_deformation_gradient_increment_d_F
d(spatial velocity gradient increment)/d(F_stab).
static InputParameters validParams()
const MaterialProperty< RankFourTensor > & _d_F_d_grad_u
d(F)/d(grad u_{n+1}) (= alpha * IdentityFour for the generalized midpoint rule)
bool isPropertyActive(const unsigned int prop_id) const
virtual void computeQpProperties() override
Update all properties (here just the stress/derivatives)
ComputeLagrangianStressBase(const InputParameters &parameters)
bool hasGuaranteedMaterialProperty(const MaterialPropertyName &prop, Guarantee guarantee)
const bool & currentlyComputingJacobian() const
virtual void initialSetup()
Add-on class that provides the functionality to check if guarantees for material properties are provi...
bool isParamSetByUser(const std::string &name) const
virtual void computeQpStressUpdate()=0
Provide for the actual stress updates.
MaterialProperty< RankFourTensor > & _cauchy_jacobian
The derivative of the Cauchy stress wrt the increment in the spatial velocity gradient.