https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
LagrangianStressDivergenceBase Class Referenceabstract

Base class of the "Lagrangian" kernel system. More...

#include <LagrangianStressDivergenceBase.h>

Inheritance diagram for LagrangianStressDivergenceBase:
[legend]

Public Types

enum  FBarMode { FBarMode::Total, FBarMode::Incremental }
 Mirrors ComputeLagrangianStrainBase::FBarMode. More...
 
typedef std::vector< intJvarMap
 

Public Member Functions

 LagrangianStressDivergenceBase (const InputParameters &parameters)
 
virtual void computeOffDiagJacobian (unsigned int jvar) override
 
unsigned int mapJvarToCvar (unsigned int jvar)
 
int mapJvarToCvar (unsigned int jvar, const JvarMap &jvar_map)
 
bool mapJvarToCvar (unsigned int jvar, unsigned int &cvar)
 
const JvarMapgetJvarMap ()
 
const JvarMapgetParameterJvarMap (std::string parameter_name)
 

Static Public Member Functions

static InputParameters validParams ()
 

Protected Member Functions

virtual RankTwoTensor gradTest (unsigned int component)=0
 
virtual RankTwoTensor gradTrial (unsigned int component)=0
 
virtual void initialSetup () override
 Derive _large_kinematics from the strain calculator's LARGE_KINEMATICS guarantee. More...
 
virtual void precalculateJacobian () override
 
virtual void precalculateOffDiagJacobian (unsigned int jvar) override
 
virtual void precalculateJacobianDisplacement (unsigned int component)=0
 Prepare the average shape function gradients for stabilization. More...
 
virtual Real computeQpJacobian () override
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar) override
 
virtual Real computeQpJacobianDisplacement (unsigned int alpha, unsigned int beta)=0
 
virtual Real computeQpJacobianTemperature (unsigned int cvar)=0
 
virtual Real computeQpJacobianOutOfPlaneStrain ()=0
 
RankTwoTensor deltaPK1NonLocalFBar (const RankTwoTensor &delta_F_avg) const
 Non-local F-bar contribution to deltaPK1 at the current _qp, given the perturbation delta_F_avg of the element-average F. More...
 
bool hasGuaranteedMaterialProperty (const MaterialPropertyName &prop, Guarantee guarantee)
 

Protected Attributes

bool _large_kinematics
 If true use large deformation kinematics. More...
 
const bool _stabilize_strain
 If true calculate the deformation gradient derivatives for F_bar. More...
 
const FBarMode _F_bar_mode
 What F gets F-bar volumetric correction (Total vs. More...
 
const std::string _base_name
 Prepend to the material properties. More...
 
const unsigned int _alpha
 Which component of the vector residual this kernel is responsible for. More...
 
const unsigned int _ndisp
 Total number of displacements/size of residual vector. More...
 
std::vector< unsigned int_disp_nums
 The displacement numbers. More...
 
std::vector< std::vector< RankTwoTensor > > _avg_grad_trial
 
std::vector< Real_avg_grad_spatial_test
 Element-averaged spatial (deformed-frame) gradient of test functions for the kernel's component _alpha: _avg_grad_spatial_test[i] = (1/V_x) int_e (grad_x test_i)_alpha dV_x Used for OLD-compat B-bar volumetric correction in F_bar_mode = incremental. More...
 
std::vector< std::vector< Real > > _avg_grad_spatial_phi
 Element-averaged spatial gradient of trial functions per component: _avg_grad_spatial_phi[component][j] = (1/V_x) int_e (grad_x phi_j)_component dV_x Populated alongside _avg_grad_spatial_test for the Jacobian's B-bar contribution. More...
 
std::vector< std::vector< std::vector< std::vector< Real > > > > _avg_test_phi_cross
 Element-averaged cross product (on displaced mesh) of spatial test/trial gradients: avg_test_phi_cross[b1][b2][i][j] = (1/V_x) int_e (grad_x test_i){b1} * (grad_x phi_j)_{b2} dV_x Indexed by [b1][b2] in {0,1,2}^2. More...
 
const MaterialProperty< RankTwoTensor > & _F_ust
 The unmodified deformation gradient. More...
 
const MaterialProperty< RankTwoTensor > & _F_ust_old
 Old unstabilized deformation gradient. More...
 
const MaterialProperty< RankTwoTensor > & _F_avg
 The element-average deformation gradient. More...
 
const MaterialProperty< RankTwoTensor > & _f_inv
 The inverse increment deformation gradient. More...
 
const MaterialProperty< RankTwoTensor > & _F_inv
 The inverse deformation gradient. More...
 
const MaterialProperty< RankTwoTensor > * _F_ust_inv = nullptr
 F_ust^{-1} and det(F_ust) from the strain calculator, consumed by the F-bar spatial push-forward (grad_x = F_ust^{-T} grad_X, J_ust = det F_ust) on both the residual and Jacobian sweeps. More...
 
const MaterialProperty< Real > * _F_ust_det = nullptr
 
const MaterialProperty< RankTwoTensor > & _F
 The actual (stabilized) deformation gradient. More...
 
const MaterialProperty< RankTwoTensor > & _F_actual
 The literal deformation gradient at n+1 (I + grad u_{n+1}), independent of alpha and F-bar. More...
 
const MaterialProperty< RankFourTensor > & _d_deformation_gradient_increment_d_F
 Derivative of the spatial velocity gradient increment w.r.t. F_{n+1}. More...
 
const MaterialProperty< RankFourTensor > & _d_F_d_grad_u
 Derivative of F_{n+1} w.r.t. the displacement gradient. More...
 
const MaterialProperty< RankFourTensor > & _d_F_stab_d_F_ust
 Partials of the F-bar-stabilized deformation gradient. More...
 
const MaterialProperty< RankFourTensor > & _d_F_stab_d_F_avg
 
const MooseVariable_temperature
 Temperature, if provided. This is used only to get the trial functions. More...
 
const MooseVariable_out_of_plane_strain
 Out-of-plane strain, if provided. More...
 
std::vector< std::vector< const MaterialProperty< RankTwoTensor > * > > _deigenstrain_dargs
 Eigenstrain derivatives wrt generate coupleds. More...
 
const MaterialProperty< RankFourTensor > * _dcauchy_stress_d_eigenstrain = nullptr
 Derivative of the Cauchy stress with respect to the eigenstrain (published by ComputeLagrangianObjectiveStress; can be overridden by other Cauchy-providing materials). More...
 
const MaterialProperty< RankFourTensor > * _d_nl_fbar = nullptr
 Composed non-local F-bar operator D_nl = cauchy_jac : d(dL)/dF : d(F_stab)/d(F_avg), published per qp by the stress material (once per element, shared by all displacement kernels). More...
 
const unsigned int _n_args
 

Detailed Description

Base class of the "Lagrangian" kernel system.

This class provides a common structure for the "new" tensor_mechanics kernel system. The goals for this new system are 1) Always-correct jacobians 2) A cleaner material interface

This class provides common input properties and helper methods, most of the math has to be done in the subclasses

Definition at line 29 of file LagrangianStressDivergenceBase.h.

Member Enumeration Documentation

◆ FBarMode

Mirrors ComputeLagrangianStrainBase::FBarMode.

Replicated here (rather than included) so this header doesn't need to pull in the templated strain header.

Enumerator
Total 
Incremental 

Definition at line 39 of file LagrangianStressDivergenceBase.h.

40  {
41  Total,
42  Incremental
43  };

Constructor & Destructor Documentation

◆ LagrangianStressDivergenceBase()

LagrangianStressDivergenceBase::LagrangianStressDivergenceBase ( const InputParameters parameters)

Definition at line 57 of file LagrangianStressDivergenceBase.C.

59  GuaranteeConsumer(this),
60  // Derived from the strain calculator's guarantee in initialSetup(); the local parameter is
61  // deprecated and only consulted for a consistency cross-check.
62  _large_kinematics(false),
63  _stabilize_strain(getParam<bool>("stabilize_strain")),
64  _F_bar_mode(getParam<MooseEnum>("F_bar_mode") == "incremental" ? FBarMode::Incremental
65  : FBarMode::Total),
66  _base_name(isParamValid("base_name") ? getParam<std::string>("base_name") + "_" : ""),
67  _alpha(getParam<unsigned int>("component")),
68  _ndisp(coupledComponents("displacements")),
72  _avg_test_phi_cross(3, std::vector<std::vector<std::vector<Real>>>(3)),
73  _F_ust(
74  getMaterialPropertyByName<RankTwoTensor>(_base_name + "unstabilized_deformation_gradient")),
75  _F_ust_old(getMaterialPropertyOldByName<RankTwoTensor>(_base_name +
76  "unstabilized_deformation_gradient")),
77  _F_avg(getMaterialPropertyByName<RankTwoTensor>(_base_name + "average_deformation_gradient")),
78  _f_inv(getMaterialPropertyByName<RankTwoTensor>(_base_name +
79  "inverse_incremental_deformation_gradient")),
80  _F_inv(getMaterialPropertyByName<RankTwoTensor>(_base_name + "inverse_deformation_gradient")),
81  _F(getMaterialPropertyByName<RankTwoTensor>(_base_name + "deformation_gradient")),
82  _F_actual(getMaterialPropertyByName<RankTwoTensor>(_base_name + "actual_deformation_gradient")),
83  _d_deformation_gradient_increment_d_F(getMaterialPropertyByName<RankFourTensor>(
84  _base_name + "d_spatial_deformation_gradient_increment_d_deformation_gradient")),
85  _d_F_d_grad_u(getMaterialPropertyByName<RankFourTensor>(
86  _base_name + "d_deformation_gradient_d_grad_displacement")),
88  getMaterialPropertyByName<RankFourTensor>(_base_name + "d_F_stab_d_F_unstabilized")),
90  getMaterialPropertyByName<RankFourTensor>(_base_name + "d_F_stab_d_F_average")),
91  _temperature(isCoupled("temperature") ? getVar("temperature", 0) : nullptr),
92  _out_of_plane_strain(isCoupled("out_of_plane_strain") ? getVar("out_of_plane_strain", 0)
93  : nullptr)
94 {
95  // Do the vector coupling of the displacements
96  for (unsigned int i = 0; i < _ndisp; i++)
97  _disp_nums[i] = coupled("displacements", i);
98 
99  // We need to use identical discretizations for all displacement components
100  auto order_x = getVar("displacements", 0)->order();
101  for (unsigned int i = 1; i < _ndisp; i++)
102  {
103  if (getVar("displacements", i)->order() != order_x)
104  mooseError("The Lagrangian StressDivergence kernels require equal "
105  "order interpolation for all displacements.");
106  }
107 
108  // fetch eigenstrain derivatives
109  const auto nvar = _coupled_moose_vars.size();
110  _deigenstrain_dargs.resize(nvar);
111  for (std::size_t i = 0; i < nvar; ++i)
112  for (auto eigenstrain_name : getParam<std::vector<MaterialPropertyName>>("eigenstrain_names"))
113  _deigenstrain_dargs[i].push_back(&getMaterialPropertyDerivative<RankTwoTensor>(
114  eigenstrain_name, _coupled_moose_vars[i]->name()));
115 
116  // The direct-chain temperature off-diagonal Jacobian needs d_sigma/d_eigenstrain. Only
117  // fetch it when eigenstrains are coupled -- otherwise the temperature Jacobian short-
118  // circuits to zero and this property would be a needless dependency that other Cauchy-
119  // providing materials would have to publish.
120  if (!getParam<std::vector<MaterialPropertyName>>("eigenstrain_names").empty())
122  &getMaterialPropertyByName<RankFourTensor>(_base_name + "dcauchy_stress_d_eigenstrain");
123 
124  // The F-bar spatial push-forward consumes F_ust^{-1}/det(F_ust) published by the strain calc.
125  // Fetch them (and thereby mark them active for the strain material's isPropertyActive gate)
126  // only when stabilization is on -- the only mode where the push-forward runs.
127  if (_stabilize_strain)
128  {
129  _F_ust_inv = &getMaterialPropertyByName<RankTwoTensor>(
130  _base_name + "inverse_unstabilized_deformation_gradient");
131  _F_ust_det =
132  &getMaterialPropertyByName<Real>(_base_name + "det_unstabilized_deformation_gradient");
133  _d_nl_fbar = &getMaterialPropertyByName<RankFourTensor>(_base_name + "d_nl_fbar_operator");
134  }
135 }
const unsigned int _alpha
Which component of the vector residual this kernel is responsible for.
const MaterialProperty< Real > * _F_ust_det
const MaterialProperty< RankTwoTensor > & _F_inv
The inverse deformation gradient.
std::vector< std::vector< RankTwoTensor > > _avg_grad_trial
std::vector< std::vector< Real > > _avg_grad_spatial_phi
Element-averaged spatial gradient of trial functions per component: _avg_grad_spatial_phi[component][...
void mooseError(Args &&... args)
const bool _stabilize_strain
If true calculate the deformation gradient derivatives for F_bar.
GuaranteeConsumer(MooseObject *moose_object)
const MaterialProperty< RankTwoTensor > & _F_avg
The element-average deformation gradient.
const MaterialProperty< RankTwoTensor > * _F_ust_inv
F_ust^{-1} and det(F_ust) from the strain calculator, consumed by the F-bar spatial push-forward (gra...
const MooseVariable * _out_of_plane_strain
Out-of-plane strain, if provided.
const MaterialProperty< RankTwoTensor > & _F
The actual (stabilized) deformation gradient.
const MaterialProperty< RankTwoTensor > & _F_ust
The unmodified deformation gradient.
const MaterialProperty< RankTwoTensor > & _F_ust_old
Old unstabilized deformation gradient.
const std::string name
Definition: Setup.h:21
const MaterialProperty< RankFourTensor > * _dcauchy_stress_d_eigenstrain
Derivative of the Cauchy stress with respect to the eigenstrain (published by ComputeLagrangianObject...
std::vector< unsigned int > _disp_nums
The displacement numbers.
const MaterialProperty< RankFourTensor > & _d_F_d_grad_u
Derivative of F_{n+1} w.r.t. the displacement gradient.
const MaterialProperty< RankFourTensor > & _d_F_stab_d_F_ust
Partials of the F-bar-stabilized deformation gradient.
const MaterialProperty< RankFourTensor > & _d_F_stab_d_F_avg
const unsigned int _ndisp
Total number of displacements/size of residual vector.
const MaterialProperty< RankFourTensor > * _d_nl_fbar
Composed non-local F-bar operator D_nl = cauchy_jac : d(dL)/dF : d(F_stab)/d(F_avg), published per qp by the stress material (once per element, shared by all displacement kernels).
const MaterialProperty< RankTwoTensor > & _F_actual
The literal deformation gradient at n+1 (I + grad u_{n+1}), independent of alpha and F-bar...
const MooseVariable * _temperature
Temperature, if provided. This is used only to get the trial functions.
const FBarMode _F_bar_mode
What F gets F-bar volumetric correction (Total vs.
const MaterialProperty< RankFourTensor > & _d_deformation_gradient_increment_d_F
Derivative of the spatial velocity gradient increment w.r.t. F_{n+1}.
std::vector< std::vector< const MaterialProperty< RankTwoTensor > * > > _deigenstrain_dargs
Eigenstrain derivatives wrt generate coupleds.
bool _large_kinematics
If true use large deformation kinematics.
const std::string _base_name
Prepend to the material properties.
std::vector< std::vector< std::vector< std::vector< Real > > > > _avg_test_phi_cross
Element-averaged cross product (on displaced mesh) of spatial test/trial gradients: avg_test_phi_cros...
const MaterialProperty< RankTwoTensor > & _f_inv
The inverse increment deformation gradient.

Member Function Documentation

◆ computeQpJacobian()

Real LagrangianStressDivergenceBase::computeQpJacobian ( )
overrideprotectedvirtual

Reimplemented in TotalLagrangianWeakPlaneStress.

Definition at line 191 of file LagrangianStressDivergenceBase.C.

192 {
194 }
const unsigned int _alpha
Which component of the vector residual this kernel is responsible for.
virtual Real computeQpJacobianDisplacement(unsigned int alpha, unsigned int beta)=0

◆ computeQpJacobianDisplacement()

virtual Real LagrangianStressDivergenceBase::computeQpJacobianDisplacement ( unsigned int  alpha,
unsigned int  beta 
)
protectedpure virtual

◆ computeQpJacobianOutOfPlaneStrain()

virtual Real LagrangianStressDivergenceBase::computeQpJacobianOutOfPlaneStrain ( )
protectedpure virtual

◆ computeQpJacobianTemperature()

virtual Real LagrangianStressDivergenceBase::computeQpJacobianTemperature ( unsigned int  cvar)
protectedpure virtual

◆ computeQpOffDiagJacobian()

Real LagrangianStressDivergenceBase::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Reimplemented in TotalLagrangianWeakPlaneStress.

Definition at line 210 of file LagrangianStressDivergenceBase.C.

211 {
212  // Bail if jvar not coupled
213  if (getJvarMap()[jvar] < 0)
214  return 0.0;
215 
216  // Off diagonal terms for other displacements
217  for (auto beta : make_range(_ndisp))
218  if (jvar == _disp_nums[beta])
220 
221  // Off diagonal temperature term due to eigenstrain
222  if (_temperature && jvar == _temperature->number())
224 
225  // Off diagonal term due to weak plane stress
228 
229  return 0;
230 }
const unsigned int _alpha
Which component of the vector residual this kernel is responsible for.
virtual Real computeQpJacobianDisplacement(unsigned int alpha, unsigned int beta)=0
unsigned int number() const
virtual Real computeQpJacobianOutOfPlaneStrain()=0
const MooseVariable * _out_of_plane_strain
Out-of-plane strain, if provided.
std::vector< unsigned int > _disp_nums
The displacement numbers.
const unsigned int _ndisp
Total number of displacements/size of residual vector.
const MooseVariable * _temperature
Temperature, if provided. This is used only to get the trial functions.
IntRange< T > make_range(T beg, T end)
virtual Real computeQpJacobianTemperature(unsigned int cvar)=0

◆ deltaPK1NonLocalFBar()

RankTwoTensor LagrangianStressDivergenceBase::deltaPK1NonLocalFBar ( const RankTwoTensor delta_F_avg) const
protected

Non-local F-bar contribution to deltaPK1 at the current _qp, given the perturbation delta_F_avg of the element-average F.

Implements the shared chain deltaF_stab_NL = _d_F_stab_d_F_avg * deltaF_avg deltadL_NL = _d_deformation_gradient_increment_d_F * deltaF_stab_NL deltasigma_NL = _cauchy_jacobian * deltadL_NL deltaPK1_NL = det(F_ust) * deltasigma_NL * F_ust^{-T} (large kinematics) = deltasigma_NL (small kinematics, PK1 == sigma) Returns zero when F-bar is off (!_stabilize_strain). Used by the TL displacement Jacobian, the WPS off-diag Jacobian, and the homogenization scalar<->disp Jacobian – anywhere the disp perturbation chains through F-bar's non-local route.

Consumes the strain/stress material's per-qp _d_nl_fbar operator so the inner (test, trial) loop pays only one R4*R2 (and, in the large-kinematics branch, one R2*R2*R2 PK1 wrap) per call instead of three R4*R2 chains plus a per-call 3x3 inverse.

Definition at line 197 of file LagrangianStressDivergenceBase.C.

Referenced by TotalLagrangianWeakPlaneStress::computeQpOffDiagJacobian(), and HomogenizedTotalLagrangianStressDivergence::computeScalarQpOffDiagJacobian().

198 {
199  if (!_stabilize_strain)
200  return RankTwoTensor();
201  // `_d_nl_fbar` (the composed non-local operator) and F_ust^{-1}/det come from the stress and
202  // strain materials as per-qp properties -- no kernel-side cache to refresh.
203  const RankTwoTensor delta_sigma_nl = (*_d_nl_fbar)[_qp] * delta_F_avg;
204  if (_large_kinematics)
205  return (*_F_ust_det)[_qp] * delta_sigma_nl * (*_F_ust_inv)[_qp].transpose();
206  return delta_sigma_nl;
207 }
const MaterialProperty< Real > * _F_ust_det
const bool _stabilize_strain
If true calculate the deformation gradient derivatives for F_bar.
RankTwoTensorTempl< Real > transpose() const
bool _large_kinematics
If true use large deformation kinematics.

◆ gradTest()

virtual RankTwoTensor LagrangianStressDivergenceBase::gradTest ( unsigned int  component)
protectedpure virtual

◆ gradTrial()

virtual RankTwoTensor LagrangianStressDivergenceBase::gradTrial ( unsigned int  component)
protectedpure virtual

◆ hasGuaranteedMaterialProperty()

bool GuaranteeConsumer::hasGuaranteedMaterialProperty ( const MaterialPropertyName &  prop,
Guarantee  guarantee 
)
protectedinherited

Definition at line 28 of file GuaranteeConsumer.C.

Referenced by ComputeFiniteStrainElasticStress::computeQpStress(), ADComputeSmearedCrackingStress::initialSetup(), ComputeSmearedCrackingStress::initialSetup(), ComputeLinearElasticPFFractureStress::initialSetup(), CriticalTimeStep::initialSetup(), ComputeStVenantKirchhoffStress::initialSetup(), ComputeMultipleInelasticStressBase::initialSetup(), ADComputeMultipleInelasticStress::initialSetup(), initialSetup(), and ComputeLagrangianStressBase::initialSetup().

30 {
32  mooseError("hasGuaranteedMaterialProperty() needs to be called in initialSetup()");
33 
34  // Reference to MaterialWarehouse for testing and retrieving block ids
35  const auto & warehouse = _gc_feproblem->getMaterialWarehouse();
36 
37  // Complete set of ids that this object is active
38  const auto & ids = (_gc_block_restrict && _gc_block_restrict->blockRestricted())
41 
42  // Loop over each id for this object
43  for (const auto & id : ids)
44  {
45  // If block materials exist, look if any issue the required guarantee
46  if (warehouse.hasActiveBlockObjects(id))
47  {
48  const std::vector<std::shared_ptr<MaterialBase>> & mats = warehouse.getActiveBlockObjects(id);
49  for (const auto & mat : mats)
50  {
51  const auto & mat_props = mat->getSuppliedItems();
52  if (mat_props.count(prop_name))
53  {
54  auto guarantee_mat = dynamic_cast<GuaranteeProvider *>(mat.get());
55  if (guarantee_mat && !guarantee_mat->hasGuarantee(prop_name, guarantee))
56  {
57  // we found at least one material on the set of block we operate on
58  // that does _not_ provide the requested guarantee
59  return false;
60  }
61  }
62  }
63  }
64  }
65 
66  return true;
67 }
void mooseError(Args &&... args)
Add-on class that provides the functionality to issue guarantees for declared material properties...
BlockRestrictable *const _gc_block_restrict
Access block restrictions of the object with this interface.
virtual const std::set< SubdomainID > & blockIDs() const
virtual bool blockRestricted() const
const MaterialWarehouse & getMaterialWarehouse() const
FEProblemBase *const _gc_feproblem
Reference to the FEProblemBase class.
virtual MooseMesh & mesh() override
virtual bool startedInitialSetup()
const std::set< SubdomainID > & meshSubdomains() const

◆ initialSetup()

void LagrangianStressDivergenceBase::initialSetup ( )
overrideprotectedvirtual

Derive _large_kinematics from the strain calculator's LARGE_KINEMATICS guarantee.

Reimplemented in UpdatedLagrangianStressDivergenceBase< G >, UpdatedLagrangianStressDivergenceBase< G >, TotalLagrangianStressDivergenceBase< G >, TotalLagrangianStressDivergenceBase< G >, TotalLagrangianStressDivergenceBase< G >, and TotalLagrangianStressDivergenceBase< G >.

Definition at line 138 of file LagrangianStressDivergenceBase.C.

Referenced by TotalLagrangianStressDivergenceBase< G >::initialSetup(), and UpdatedLagrangianStressDivergenceBase< G >::initialSetup().

139 {
141 
142  // Derive the kinematics regime from the strain calculator's LARGE_KINEMATICS guarantee -- the
143  // single source of truth. hasGuaranteedMaterialProperty is block-restricted (per subdomain) and
144  // keyed by the base_name-prefixed deformation_gradient, so a given base_name resolves against its
145  // own strain calculator.
148 
149  // The deprecated local parameter must not silently disagree with the strain calculator.
150  if (isParamSetByUser("large_kinematics") &&
151  getParam<bool>("large_kinematics") != _large_kinematics)
152  paramError("large_kinematics",
153  "large_kinematics disagrees with the ComputeLagrangianStrain calculator (which "
154  "computes ",
155  _large_kinematics ? "large" : "small",
156  " kinematics). large_kinematics is deprecated here; set it only on the strain "
157  "calculator.");
158 }
bool hasGuaranteedMaterialProperty(const MaterialPropertyName &prop, Guarantee guarantee)
bool _large_kinematics
If true use large deformation kinematics.
const std::string _base_name
Prepend to the material properties.
virtual void initialSetup() override
Derive _large_kinematics from the strain calculator&#39;s LARGE_KINEMATICS guarantee. ...

◆ precalculateJacobian()

void LagrangianStressDivergenceBase::precalculateJacobian ( )
overrideprotectedvirtual

Reimplemented in TotalLagrangianStressDivergenceBase< G >, and TotalLagrangianWeakPlaneStress.

Definition at line 161 of file LagrangianStressDivergenceBase.C.

Referenced by TotalLagrangianStressDivergenceBase< G >::precalculateJacobian().

162 {
163  // Skip if we are not doing stabilization
164  if (!_stabilize_strain)
165  return;
166 
167  // We need the gradients of shape functions in the reference frame
168  _fe_problem.prepareShapes(_var.number(), _tid);
169  _avg_grad_trial[_alpha].resize(_phi.size());
171 }
const unsigned int _alpha
Which component of the vector residual this kernel is responsible for.
std::vector< std::vector< RankTwoTensor > > _avg_grad_trial
virtual void precalculateJacobianDisplacement(unsigned int component)=0
Prepare the average shape function gradients for stabilization.
const bool _stabilize_strain
If true calculate the deformation gradient derivatives for F_bar.

◆ precalculateJacobianDisplacement()

virtual void LagrangianStressDivergenceBase::precalculateJacobianDisplacement ( unsigned int  component)
protectedpure virtual

Prepare the average shape function gradients for stabilization.

Implemented in UpdatedLagrangianStressDivergenceBase< G >, and TotalLagrangianStressDivergenceBase< G >.

Referenced by precalculateJacobian(), and precalculateOffDiagJacobian().

◆ precalculateOffDiagJacobian()

void LagrangianStressDivergenceBase::precalculateOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtual

Reimplemented in TotalLagrangianStressDivergenceBase< G >.

Definition at line 174 of file LagrangianStressDivergenceBase.C.

Referenced by TotalLagrangianStressDivergenceBase< G >::precalculateOffDiagJacobian().

175 {
176  // Skip if we are not doing stabilization
177  if (!_stabilize_strain)
178  return;
179 
180  for (auto beta : make_range(_ndisp))
181  if (jvar == _disp_nums[beta])
182  {
183  // We need the gradients of shape functions in the reference frame
184  _fe_problem.prepareShapes(jvar, _tid);
185  _avg_grad_trial[beta].resize(_phi.size());
187  }
188 }
std::vector< std::vector< RankTwoTensor > > _avg_grad_trial
virtual void precalculateJacobianDisplacement(unsigned int component)=0
Prepare the average shape function gradients for stabilization.
const bool _stabilize_strain
If true calculate the deformation gradient derivatives for F_bar.
std::vector< unsigned int > _disp_nums
The displacement numbers.
const unsigned int _ndisp
Total number of displacements/size of residual vector.
IntRange< T > make_range(T beg, T end)

◆ validParams()

InputParameters LagrangianStressDivergenceBase::validParams ( )
static

Definition at line 14 of file LagrangianStressDivergenceBase.C.

Referenced by TotalLagrangianStressDivergenceBase< G >::baseParams(), and UpdatedLagrangianStressDivergenceBase< G >::baseParams().

15 {
17 
18  params.addRequiredParam<unsigned int>("component", "Which direction this kernel acts in");
19  params.addRequiredCoupledVar("displacements", "The displacement components");
20 
21  params.addDeprecatedParam<bool>(
22  "large_kinematics",
23  false,
24  "Use large displacement kinematics",
25  "large_kinematics is no longer set on the stress-divergence kernel; it is derived from the "
26  "ComputeLagrangianStrain calculator (the single source of truth) via the LARGE_KINEMATICS "
27  "guarantee. Remove it here and set it only on the strain calculator.");
28  params.addParam<bool>("stabilize_strain", false, "Average the volumetric strains");
29  MooseEnum F_bar_mode("total incremental", "total");
30  params.addParam<MooseEnum>(
31  "F_bar_mode",
32  F_bar_mode,
33  "Which F gets the F-bar volumetric correction (must match the strain calc's setting). "
34  "'total' (default) reproduces existing behavior; 'incremental' makes the F-bar element-"
35  "average operate on the incremental F so cumulative strain matches OLD's "
36  "`ComputeFiniteStrain` + `volumetric_locking_correction = true`.");
37 
38  params.addParam<std::string>("base_name", "Material property base name");
39 
40  params.addCoupledVar("temperature",
41  "The name of the temperature variable used in the "
42  "ComputeThermalExpansionEigenstrain. (Not required for "
43  "simulations without temperature coupling.)");
44 
45  params.addParam<std::vector<MaterialPropertyName>>(
46  "eigenstrain_names",
47  {},
48  "List of eigenstrains used in the strain calculation. Used for computing their derivatives "
49  "for off-diagonal Jacobian terms.");
50 
51  params.addCoupledVar("out_of_plane_strain",
52  "The out-of-plane strain variable for weak plane stress formulation.");
53 
54  return params;
55 }
void addDeprecatedParam(const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addCoupledVar(const std::string &name, const std::string &doc_string)
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
static InputParameters validParams()

Member Data Documentation

◆ _alpha

const unsigned int LagrangianStressDivergenceBase::_alpha
protected

◆ _avg_grad_spatial_phi

std::vector<std::vector<Real> > LagrangianStressDivergenceBase::_avg_grad_spatial_phi
protected

Element-averaged spatial gradient of trial functions per component: _avg_grad_spatial_phi[component][j] = (1/V_x) int_e (grad_x phi_j)_component dV_x Populated alongside _avg_grad_spatial_test for the Jacobian's B-bar contribution.

Definition at line 134 of file LagrangianStressDivergenceBase.h.

◆ _avg_grad_spatial_test

std::vector<Real> LagrangianStressDivergenceBase::_avg_grad_spatial_test
protected

Element-averaged spatial (deformed-frame) gradient of test functions for the kernel's component _alpha: _avg_grad_spatial_test[i] = (1/V_x) int_e (grad_x test_i)_alpha dV_x Used for OLD-compat B-bar volumetric correction in F_bar_mode = incremental.

Populated by the TL kernel's precalculateResidual / precalculateJacobian overrides when _stabilize_strain == true. The trial-function analog is published per (component, j) in _avg_grad_spatial_phi and used by the Jacobian.

Definition at line 129 of file LagrangianStressDivergenceBase.h.

◆ _avg_grad_trial

std::vector<std::vector<RankTwoTensor> > LagrangianStressDivergenceBase::_avg_grad_trial
protected

◆ _avg_test_phi_cross

std::vector<std::vector<std::vector<std::vector<Real> > > > LagrangianStressDivergenceBase::_avg_test_phi_cross
protected

Element-averaged cross product (on displaced mesh) of spatial test/trial gradients: avg_test_phi_cross[b1][b2][i][j] = (1/V_x) int_e (grad_x test_i){b1} * (grad_x phi_j)_{b2} dV_x Indexed by [b1][b2] in {0,1,2}^2.

Only the (b1, b2) entries needed for the current Jacobian call are populated by the TL kernel's computeAvgTestPhiCross(beta) helper. Used for the B-bar Jacobian's non-local term (d(avg_grad_spatial_test)/dU).

Definition at line 141 of file LagrangianStressDivergenceBase.h.

◆ _base_name

const std::string LagrangianStressDivergenceBase::_base_name
protected

Prepend to the material properties.

Definition at line 106 of file LagrangianStressDivergenceBase.h.

Referenced by initialSetup(), and LagrangianStressDivergenceBase().

◆ _d_deformation_gradient_increment_d_F

const MaterialProperty<RankFourTensor>& LagrangianStressDivergenceBase::_d_deformation_gradient_increment_d_F
protected

Derivative of the spatial velocity gradient increment w.r.t. F_{n+1}.

Definition at line 177 of file LagrangianStressDivergenceBase.h.

◆ _d_F_d_grad_u

const MaterialProperty<RankFourTensor>& LagrangianStressDivergenceBase::_d_F_d_grad_u
protected

◆ _d_F_stab_d_F_avg

const MaterialProperty<RankFourTensor>& LagrangianStressDivergenceBase::_d_F_stab_d_F_avg
protected

◆ _d_F_stab_d_F_ust

const MaterialProperty<RankFourTensor>& LagrangianStressDivergenceBase::_d_F_stab_d_F_ust
protected

Partials of the F-bar-stabilized deformation gradient.

Used by the UL kernel to assemble the F-bar Jacobian contribution. For F-bar off, _d_F_stab_d_F_ust = I^(4) and _d_F_stab_d_F_avg = 0, so the kernel chain reduces to the unstabilized case. TL also uses _d_F_stab_d_F_avg directly for the non-local F-bar Jacobian contribution to PK1 (since after the F_ust-wrap architectural change PK1 = det(F_ust) sigma F_ust^{-T} no longer contains the non-local F-bar effect – it has to enter through the sigma-via-dL chain explicitly).

Definition at line 189 of file LagrangianStressDivergenceBase.h.

Referenced by HomogenizedTotalLagrangianStressDivergence::computeScalarQpOffDiagJacobian().

◆ _d_nl_fbar

const MaterialProperty<RankFourTensor>* LagrangianStressDivergenceBase::_d_nl_fbar = nullptr
protected

Composed non-local F-bar operator D_nl = cauchy_jac : d(dL)/dF : d(F_stab)/d(F_avg), published per qp by the stress material (once per element, shared by all displacement kernels).

deltaPK1NonLocalFBar(deltaF_avg) collapses to one R4*R2 contraction against it. Fetched only when _stabilize_strain (nullptr otherwise).

Definition at line 212 of file LagrangianStressDivergenceBase.h.

Referenced by LagrangianStressDivergenceBase().

◆ _dcauchy_stress_d_eigenstrain

const MaterialProperty<RankFourTensor>* LagrangianStressDivergenceBase::_dcauchy_stress_d_eigenstrain = nullptr
protected

Derivative of the Cauchy stress with respect to the eigenstrain (published by ComputeLagrangianObjectiveStress; can be overridden by other Cauchy-providing materials).

Only fetched when eigenstrains are coupled, since only the temperature off-diagonal Jacobian needs it. Will be nullptr otherwise; subclasses that consume it must guard accordingly.

Definition at line 206 of file LagrangianStressDivergenceBase.h.

Referenced by LagrangianStressDivergenceBase().

◆ _deigenstrain_dargs

std::vector<std::vector<const MaterialProperty<RankTwoTensor> *> > LagrangianStressDivergenceBase::_deigenstrain_dargs
protected

Eigenstrain derivatives wrt generate coupleds.

Definition at line 199 of file LagrangianStressDivergenceBase.h.

Referenced by LagrangianStressDivergenceBase().

◆ _disp_nums

std::vector<unsigned int> LagrangianStressDivergenceBase::_disp_nums
protected

◆ _F

const MaterialProperty<RankTwoTensor>& LagrangianStressDivergenceBase::_F
protected

The actual (stabilized) deformation gradient.

With the generalized midpoint rule this is the alpha-weighted F, NOT the literal F at n+1.

Definition at line 170 of file LagrangianStressDivergenceBase.h.

Referenced by HomogenizedTotalLagrangianStressDivergence::computeScalarResidual().

◆ _F_actual

const MaterialProperty<RankTwoTensor>& LagrangianStressDivergenceBase::_F_actual
protected

The literal deformation gradient at n+1 (I + grad u_{n+1}), independent of alpha and F-bar.

Used by the UL kernel to convert spatial gradients to reference-frame gradients.

Definition at line 174 of file LagrangianStressDivergenceBase.h.

◆ _F_avg

const MaterialProperty<RankTwoTensor>& LagrangianStressDivergenceBase::_F_avg
protected

The element-average deformation gradient.

Definition at line 152 of file LagrangianStressDivergenceBase.h.

◆ _F_bar_mode

const FBarMode LagrangianStressDivergenceBase::_F_bar_mode
protected

What F gets F-bar volumetric correction (Total vs.

Incremental). Must match the strain calc's F_bar_mode. Incremental mode changes how _avg_grad_trial is computed so the non-local F-bar chain captures deltaf_avg (= avg of deltaF_ust * F_ust_old^{-1}) instead of deltaF_avg.

Definition at line 103 of file LagrangianStressDivergenceBase.h.

Referenced by UpdatedLagrangianStressDivergenceBase< G >::UpdatedLagrangianStressDivergenceBase().

◆ _f_inv

const MaterialProperty<RankTwoTensor>& LagrangianStressDivergenceBase::_f_inv
protected

The inverse increment deformation gradient.

Definition at line 155 of file LagrangianStressDivergenceBase.h.

◆ _F_inv

const MaterialProperty<RankTwoTensor>& LagrangianStressDivergenceBase::_F_inv
protected

The inverse deformation gradient.

Definition at line 158 of file LagrangianStressDivergenceBase.h.

◆ _F_ust

const MaterialProperty<RankTwoTensor>& LagrangianStressDivergenceBase::_F_ust
protected

The unmodified deformation gradient.

Definition at line 144 of file LagrangianStressDivergenceBase.h.

◆ _F_ust_det

const MaterialProperty<Real>* LagrangianStressDivergenceBase::_F_ust_det = nullptr
protected

◆ _F_ust_inv

const MaterialProperty<RankTwoTensor>* LagrangianStressDivergenceBase::_F_ust_inv = nullptr
protected

F_ust^{-1} and det(F_ust) from the strain calculator, consumed by the F-bar spatial push-forward (grad_x = F_ust^{-T} grad_X, J_ust = det F_ust) on both the residual and Jacobian sweeps.

Fetched only when _stabilize_strain (nullptr otherwise). The strain material computes them once per qp (shared by all displacement kernels), replacing the former per-kernel F_ust-inverse/det cache and the per-test/trial recomputation.

Definition at line 165 of file LagrangianStressDivergenceBase.h.

Referenced by LagrangianStressDivergenceBase().

◆ _F_ust_old

const MaterialProperty<RankTwoTensor>& LagrangianStressDivergenceBase::_F_ust_old
protected

Old unstabilized deformation gradient.

Only consulted in F_bar_mode = incremental for the kernel's element-average of grad_phi * F_ust_old^{-1}. Always fetched (cheap) so the kernel doesn't need conditional property bookkeeping.

Definition at line 149 of file LagrangianStressDivergenceBase.h.

◆ _large_kinematics

bool LagrangianStressDivergenceBase::_large_kinematics
protected

If true use large deformation kinematics.

Derived in initialSetup() from the strain calculator's LARGE_KINEMATICS guarantee (single source of truth); the kernel's own large_kinematics parameter is deprecated.

Definition at line 95 of file LagrangianStressDivergenceBase.h.

Referenced by HomogenizedTotalLagrangianStressDivergence::computeScalarJacobian(), HomogenizedTotalLagrangianStressDivergence::computeScalarQpOffDiagJacobian(), HomogenizedTotalLagrangianStressDivergence::computeScalarResidual(), deltaPK1NonLocalFBar(), and initialSetup().

◆ _ndisp

const unsigned int LagrangianStressDivergenceBase::_ndisp
protected

◆ _out_of_plane_strain

const MooseVariable* LagrangianStressDivergenceBase::_out_of_plane_strain
protected

◆ _stabilize_strain

const bool LagrangianStressDivergenceBase::_stabilize_strain
protected

◆ _temperature

const MooseVariable* LagrangianStressDivergenceBase::_temperature
protected

Temperature, if provided. This is used only to get the trial functions.

Definition at line 193 of file LagrangianStressDivergenceBase.h.

Referenced by computeQpOffDiagJacobian().


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