https://mooseframework.inl.gov
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
UpdatedLagrangianStressDivergenceBase< G > Class Template Reference

Enforce equilibrium with an updated Lagrangian formulation. More...

#include <UpdatedLagrangianStressDivergence.h>

Inheritance diagram for UpdatedLagrangianStressDivergenceBase< G >:
[legend]

Public Types

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

Public Member Functions

 UpdatedLagrangianStressDivergenceBase (const InputParameters &parameters)
 
virtual void initialSetup () override
 Derive _large_kinematics from the strain calculator's LARGE_KINEMATICS guarantee. More...
 
template<>
InputParameters validParams ()
 
template<>
void initialSetup ()
 Derive _large_kinematics from the strain calculator's LARGE_KINEMATICS guarantee. More...
 
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 baseParams ()
 
static InputParameters validParams ()
 

Protected Member Functions

virtual RankTwoTensor gradTest (unsigned int component) override
 
virtual RankTwoTensor gradTrial (unsigned int component) override
 
virtual void precalculateJacobianDisplacement (unsigned int component) override
 Prepare the average shape function gradients for stabilization. More...
 
virtual Real computeQpResidual () override
 
virtual Real computeQpJacobianDisplacement (unsigned int alpha, unsigned int beta) override
 
virtual Real computeQpJacobianTemperature (unsigned int cvar) override
 
virtual Real computeQpJacobianOutOfPlaneStrain () override
 
virtual void precalculateJacobian () override
 
virtual void precalculateOffDiagJacobian (unsigned int jvar) override
 
virtual Real computeQpJacobian () override
 
virtual Real computeQpOffDiagJacobian (unsigned int jvar) override
 
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

const MaterialProperty< RankTwoTensor > & _stress
 The Cauchy stress. More...
 
const MaterialProperty< RankFourTensor > & _material_jacobian
 
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
 
Assembly_assembly_undisplaced
 
const VariablePhiGradient_grad_phi_undisplaced
 
const MooseArray< Real > & _JxW_undisplaced
 
const MooseArray< Real > & _coord_undisplaced
 
const MooseArray< Point > & _q_point_undisplaced
 

Private Member Functions

virtual RankTwoTensor gradTrialUnstabilized (unsigned int component)
 The unstabilized trial function gradient. More...
 

Detailed Description

template<class G>
class UpdatedLagrangianStressDivergenceBase< G >

Enforce equilibrium with an updated Lagrangian formulation.

This class enforces equilibrium when used in conjunction with the corresponding strain calculator (CalculateStrainLagrangianKernel) and with either a stress calculator that provides the Cauchy stress ("stress") and the appropriate "cauchy_jacobian", which needs to be the derivative of the increment in Cauchy stress with respect to the increment in the spatial velocity gradient.

This kernel should be used with the new "ComputeLagrangianStressBase" stress update system and the "ComputeLagrangianStrain" system for strains.

use_displaced_mesh must be true for large deformation kinematics The kernel enforces this with an error

Definition at line 32 of file UpdatedLagrangianStressDivergence.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

◆ UpdatedLagrangianStressDivergenceBase()

Definition at line 15 of file UpdatedLagrangianStressDivergence.C.

17  : LagrangianStressDivergenceBase(parameters),
18  _stress(getMaterialPropertyByName<RankTwoTensor>(_base_name + "cauchy_stress")),
19  _material_jacobian(getMaterialPropertyByName<RankFourTensor>(_base_name + "cauchy_jacobian")),
20 
21  // Assembly quantities in the reference frame for stabilization
22  _assembly_undisplaced(_fe_problem.assembly(_tid, this->_sys.number())),
27 {
28  // The use_displaced_mesh <-> large_kinematics consistency check lives in initialSetup(), since
29  // large_kinematics is now derived from the strain calculator's guarantee (not available in the
30  // constructor).
31 
32  // TODO: add weak plane stress support
34  mooseError("The UpdatedLagrangianStressDivergence kernels do not yet support the weak plane "
35  "stress formulation. Please use the TotalLagrangianStressDivergecen kernels.");
36 
37  // The UL push-forward in `precalculateJacobianDisplacement` uses `_F_avg` (= avg(F_ust))
38  // for the spatial-to-reference frame mapping; combining it with the incremental F-bar
39  // chain (which expects `_avg_grad_trial` to represent deltaf_avg, not deltaF_avg) hasn't been
40  // worked out yet. Use Total Lagrangian for incremental F-bar.
42  mooseError("`F_bar_mode = incremental` is not yet supported with the UpdatedLagrangian "
43  "kernels; use TotalLagrangianStressDivergence (or `F_bar_mode = total`).");
44 }
void mooseError(Args &&... args)
LagrangianStressDivergenceBase(const InputParameters &parameters)
const bool _stabilize_strain
If true calculate the deformation gradient derivatives for F_bar.
const VariablePhiGradient & gradPhi() const
const MooseArray< Point > & qPoints() const
const MooseVariable * _out_of_plane_strain
Out-of-plane strain, if provided.
const MooseArray< Real > & coordTransformation() const
const MooseArray< Real > & JxW() const
const MaterialProperty< RankTwoTensor > & _stress
The Cauchy stress.
const MaterialProperty< RankFourTensor > & _material_jacobian
const FBarMode _F_bar_mode
What F gets F-bar volumetric correction (Total vs.
const std::string _base_name
Prepend to the material properties.

Member Function Documentation

◆ baseParams()

template<class G >
static InputParameters UpdatedLagrangianStressDivergenceBase< G >::baseParams ( )
inlinestatic

◆ computeQpJacobian()

Real LagrangianStressDivergenceBase::computeQpJacobian ( )
overrideprotectedvirtualinherited

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()

template<class G >
Real UpdatedLagrangianStressDivergenceBase< G >::computeQpJacobianDisplacement ( unsigned int  alpha,
unsigned int  beta 
)
overrideprotectedvirtual

Implements LagrangianStressDivergenceBase.

Definition at line 104 of file UpdatedLagrangianStressDivergence.C.

106 {
107  const auto grad_test = gradTest(alpha);
108  const auto grad_trial = gradTrialUnstabilized(beta);
109 
110  // J^{alpha beta} = J^{alpha beta}_material + J^{alpha beta}_geometric
111  // J^{alpha beta}_material = phi^alpha : T : d(dL)/d(grad u) * grad_trial
112  // J^{alpha beta}_geometric = sigma_{ij} (phi^alpha_{k, k} psi^beta_{i, j} -
113  // phi^alpha_{k, j} psi^beta_{i, k})
114 
115  // Local contribution to delta(F_ust): pull the spatial trial gradient back through the
116  // literal n+1 deformation gradient (use_displaced_mesh = true uses F_actual, regardless
117  // of alpha or F-bar), then chain to F_ust via _d_F_d_grad_u (= alpha * I^(4)).
118  const RankTwoTensor delta_grad_u_local =
119  _large_kinematics ? grad_trial * _F_actual[_qp] : grad_trial;
120  const RankTwoTensor delta_F_ust_local = _d_F_d_grad_u[_qp] * delta_grad_u_local;
121 
122  // Non-local F-bar contribution to delta(F_avg): _avg_grad_trial is stored as
123  // avg(gradTrial_reference) * F_avg^{-1} (see precalculateJacobianDisplacement). Multiply
124  // by F_avg to recover the reference-frame averaged gradient, then chain to F_ust the
125  // same way.
126  RankTwoTensor delta_F_avg;
127  if (_stabilize_strain)
128  {
129  const RankTwoTensor delta_grad_u_avg =
130  _large_kinematics ? _avg_grad_trial[beta][_j] * _F_avg[_qp] : _avg_grad_trial[beta][_j];
131  delta_F_avg = _d_F_d_grad_u[_qp] * delta_grad_u_avg;
132  }
133 
134  // Stabilized delta(F_stab) through the F-bar tangent. With F-bar off, the partials are
135  // _d_F_stab_d_F_ust = I^(4) and _d_F_stab_d_F_avg = 0, so this reduces to delta_F_ust_local.
136  const RankTwoTensor delta_F_stab =
137  _d_F_stab_d_F_ust[_qp] * delta_F_ust_local + _d_F_stab_d_F_avg[_qp] * delta_F_avg;
138 
139  const RankTwoTensor delta_dL = _d_deformation_gradient_increment_d_F[_qp] * delta_F_stab;
140 
141  // The material jacobian
142  Real J = grad_test.doubleContraction(_material_jacobian[_qp] * delta_dL);
143 
144  // The geometric jacobian (no F-bar stabilization in this term)
145  if (_large_kinematics)
146  {
147  J += _stress[_qp].doubleContraction(grad_test) * grad_trial.trace() -
148  _stress[_qp].doubleContraction(grad_test * grad_trial);
149  }
150 
151  return J;
152 }
std::vector< std::vector< RankTwoTensor > > _avg_grad_trial
virtual RankTwoTensor gradTest(unsigned int component) override
const bool _stabilize_strain
If true calculate the deformation gradient derivatives for F_bar.
const MaterialProperty< RankTwoTensor > & _F_avg
The element-average deformation gradient.
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< RankTwoTensor > & _stress
The Cauchy stress.
const MaterialProperty< RankFourTensor > & _material_jacobian
virtual RankTwoTensor gradTrialUnstabilized(unsigned int component)
The unstabilized trial function gradient.
const MaterialProperty< RankFourTensor > & _d_F_stab_d_F_avg
const MaterialProperty< RankTwoTensor > & _F_actual
The literal deformation gradient at n+1 (I + grad u_{n+1}), independent of alpha and F-bar...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static const std::string alpha
Definition: NS.h:138
const MaterialProperty< RankFourTensor > & _d_deformation_gradient_increment_d_F
Derivative of the spatial velocity gradient increment w.r.t. F_{n+1}.
bool _large_kinematics
If true use large deformation kinematics.

◆ computeQpJacobianOutOfPlaneStrain()

template<class G >
virtual Real UpdatedLagrangianStressDivergenceBase< G >::computeQpJacobianOutOfPlaneStrain ( )
inlineoverrideprotectedvirtual

Implements LagrangianStressDivergenceBase.

Definition at line 51 of file UpdatedLagrangianStressDivergence.h.

51 { return 0; }

◆ computeQpJacobianTemperature()

template<class G >
Real UpdatedLagrangianStressDivergenceBase< G >::computeQpJacobianTemperature ( unsigned int  cvar)
overrideprotectedvirtual

Implements LagrangianStressDivergenceBase.

Definition at line 156 of file UpdatedLagrangianStressDivergence.C.

157 {
158  // Multiple eigenstrains may depend on the same coupled var
159  RankTwoTensor total_deigen;
160  for (const auto deigen_darg : _deigenstrain_dargs[cvar])
161  total_deigen += (*deigen_darg)[_qp];
162 
164  RankFourTensor Csym = 0.5 * (C + C.transposeMajor().transposeIj().transposeMajor());
165 
166  return -(Csym * total_deigen).doubleContraction(gradTest(_alpha)) * _temperature->phi()[_j][_qp];
167 }
const unsigned int _alpha
Which component of the vector residual this kernel is responsible for.
virtual RankTwoTensor gradTest(unsigned int component) override
const FieldVariablePhiValue & phi() const override
const MaterialProperty< RankFourTensor > & _material_jacobian
const MooseVariable * _temperature
Temperature, if provided. This is used only to get the trial functions.
std::vector< std::vector< const MaterialProperty< RankTwoTensor > * > > _deigenstrain_dargs
Eigenstrain derivatives wrt generate coupleds.
static const std::string C
Definition: NS.h:172

◆ computeQpOffDiagJacobian()

Real LagrangianStressDivergenceBase::computeQpOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtualinherited

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

◆ computeQpResidual()

template<class G >
Real UpdatedLagrangianStressDivergenceBase< G >::computeQpResidual ( )
overrideprotectedvirtual

Definition at line 97 of file UpdatedLagrangianStressDivergence.C.

98 {
100 }
const unsigned int _alpha
Which component of the vector residual this kernel is responsible for.
virtual RankTwoTensor gradTest(unsigned int component) override
Real doubleContraction(const RankTwoTensorTempl< Real > &a) const
const MaterialProperty< RankTwoTensor > & _stress
The Cauchy stress.

◆ deltaPK1NonLocalFBar()

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

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()

template<class G >
RankTwoTensor UpdatedLagrangianStressDivergenceBase< G >::gradTest ( unsigned int  component)
overrideprotectedvirtual

Implements LagrangianStressDivergenceBase.

Definition at line 48 of file UpdatedLagrangianStressDivergence.C.

49 {
50  // F-bar doesn't modify the test function
51  return G::gradOp(component, _grad_test[_i][_qp], _test[_i][_qp], _q_point[_qp]);
52 }
static const std::string component
Definition: NS.h:157

◆ gradTrial()

template<class G >
RankTwoTensor UpdatedLagrangianStressDivergenceBase< G >::gradTrial ( unsigned int  component)
overrideprotectedvirtual

Implements LagrangianStressDivergenceBase.

Definition at line 56 of file UpdatedLagrangianStressDivergence.C.

57 {
58  // F-bar stabilization is handled explicitly in computeQpJacobianDisplacement via the stored
59  // partial derivatives _d_F_stab_d_F_ust and _d_F_stab_d_F_avg, so gradTrial always returns
60  // the unstabilized spatial gradient.
62 }
static const std::string component
Definition: NS.h:157
virtual RankTwoTensor gradTrialUnstabilized(unsigned int component)
The unstabilized trial function gradient.

◆ gradTrialUnstabilized()

template<class G >
RankTwoTensor UpdatedLagrangianStressDivergenceBase< G >::gradTrialUnstabilized ( unsigned int  component)
privatevirtual

The unstabilized trial function gradient.

F-bar stabilization is handled explicitly in computeQpJacobianDisplacement via the strain-calculator F-bar partials, so the UL kernel does not need a separate gradTrialStabilized helper.

Definition at line 66 of file UpdatedLagrangianStressDivergence.C.

67 {
68  // Without F-bar stabilization, simply return the gradient of the trial functions
69  return G::gradOp(component, _grad_phi[_j][_qp], _phi[_j][_qp], _q_point[_qp]);
70 }
static const std::string component
Definition: NS.h:157

◆ 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(), LagrangianStressDivergenceBase::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() [1/2]

template<class G >
virtual void UpdatedLagrangianStressDivergenceBase< G >::initialSetup ( )
overridevirtual

Derive _large_kinematics from the strain calculator's LARGE_KINEMATICS guarantee.

Reimplemented from LagrangianStressDivergenceBase.

◆ initialSetup() [2/2]

template<>
void UpdatedLagrangianStressDivergenceBase< GradientOperatorCartesian >::initialSetup ( )
inlinevirtual

Derive _large_kinematics from the strain calculator's LARGE_KINEMATICS guarantee.

Reimplemented from LagrangianStressDivergenceBase.

Definition at line 88 of file UpdatedLagrangianStressDivergence.h.

89 {
90  // Derives _large_kinematics from the strain calculator's LARGE_KINEMATICS guarantee.
92 
93  if (getBlockCoordSystem() != Moose::COORD_XYZ)
94  mooseError("This kernel should only act in Cartesian coordinates.");
95 
96  // The updated Lagrangian kernel integrates on the displaced mesh iff large kinematics is on;
97  // large_kinematics is derived from the strain calculator, so validate the pairing here.
98  if (_large_kinematics && !getParam<bool>("use_displaced_mesh"))
99  mooseError("The UpdatedLagrangianStressDivergence kernels require use_displaced_mesh = true "
100  "for large_kinematics = true");
101  if (!_large_kinematics && getParam<bool>("use_displaced_mesh"))
102  mooseError("The UpdatedLagrangianStressDivergence kernels require use_displaced_mesh = false "
103  "for large_kinematics = false");
104 }
void mooseError(Args &&... args)
bool _large_kinematics
If true use large deformation kinematics.
virtual void initialSetup() override
Derive _large_kinematics from the strain calculator&#39;s LARGE_KINEMATICS guarantee. ...

◆ precalculateJacobian()

void LagrangianStressDivergenceBase::precalculateJacobian ( )
overrideprotectedvirtualinherited

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()

template<class G >
void UpdatedLagrangianStressDivergenceBase< G >::precalculateJacobianDisplacement ( unsigned int  component)
overrideprotectedvirtual

Prepare the average shape function gradients for stabilization.

Implements LagrangianStressDivergenceBase.

Definition at line 74 of file UpdatedLagrangianStressDivergence.C.

75 {
76  // For updated Lagrangian, the averaging is taken on the reference frame. If large kinematics is
77  // used, the averaged gradients should be pushed forward to the current frame.
78  for (auto j : make_range(_phi.size()))
79  {
81  [this, component, j](unsigned int qp)
82  {
83  return G::gradOp(
85  },
89  // Push forward to the current frame.
90  // The average deformation gradient is the same at all qps.
91  _avg_grad_trial[component][j] *= _F_avg[0].inverse();
92  }
93 }
std::vector< std::vector< RankTwoTensor > > _avg_grad_trial
static const std::string component
Definition: NS.h:157
const MaterialProperty< RankTwoTensor > & _F_avg
The element-average deformation gradient.
IntRange< T > make_range(T beg, T end)
auto elementAverage(const Functor &f, const MooseArray< Real > &JxW, const MooseArray< Real > &coord)
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
bool _large_kinematics
If true use large deformation kinematics.

◆ precalculateOffDiagJacobian()

void LagrangianStressDivergenceBase::precalculateOffDiagJacobian ( unsigned int  jvar)
overrideprotectedvirtualinherited

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() [1/2]

template<class G >
static InputParameters UpdatedLagrangianStressDivergenceBase< G >::validParams ( )
static

◆ validParams() [2/2]

Definition at line 78 of file UpdatedLagrangianStressDivergence.h.

79 {
81  params.addClassDescription(
82  "Enforce equilibrium with an updated Lagrangian formulation in Cartesian coordinates.");
83  return params;
84 }
void addClassDescription(const std::string &doc_string)

Member Data Documentation

◆ _alpha

const unsigned int LagrangianStressDivergenceBase::_alpha
protectedinherited

◆ _assembly_undisplaced

template<class G >
Assembly& UpdatedLagrangianStressDivergenceBase< G >::_assembly_undisplaced
protected

Definition at line 62 of file UpdatedLagrangianStressDivergence.h.

◆ _avg_grad_spatial_phi

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

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
protectedinherited

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
protectedinherited

◆ _avg_test_phi_cross

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

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
protectedinherited

◆ _coord_undisplaced

template<class G >
const MooseArray<Real>& UpdatedLagrangianStressDivergenceBase< G >::_coord_undisplaced
protected

Definition at line 65 of file UpdatedLagrangianStressDivergence.h.

◆ _d_deformation_gradient_increment_d_F

const MaterialProperty<RankFourTensor>& LagrangianStressDivergenceBase::_d_deformation_gradient_increment_d_F
protectedinherited

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
protectedinherited

◆ _d_F_stab_d_F_avg

const MaterialProperty<RankFourTensor>& LagrangianStressDivergenceBase::_d_F_stab_d_F_avg
protectedinherited

◆ _d_F_stab_d_F_ust

const MaterialProperty<RankFourTensor>& LagrangianStressDivergenceBase::_d_F_stab_d_F_ust
protectedinherited

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
protectedinherited

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::LagrangianStressDivergenceBase().

◆ _dcauchy_stress_d_eigenstrain

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

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::LagrangianStressDivergenceBase().

◆ _deigenstrain_dargs

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

Eigenstrain derivatives wrt generate coupleds.

Definition at line 199 of file LagrangianStressDivergenceBase.h.

Referenced by LagrangianStressDivergenceBase::LagrangianStressDivergenceBase().

◆ _disp_nums

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

◆ _F

const MaterialProperty<RankTwoTensor>& LagrangianStressDivergenceBase::_F
protectedinherited

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
protectedinherited

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
protectedinherited

The element-average deformation gradient.

Definition at line 152 of file LagrangianStressDivergenceBase.h.

◆ _F_bar_mode

const FBarMode LagrangianStressDivergenceBase::_F_bar_mode
protectedinherited

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
protectedinherited

The inverse increment deformation gradient.

Definition at line 155 of file LagrangianStressDivergenceBase.h.

◆ _F_inv

const MaterialProperty<RankTwoTensor>& LagrangianStressDivergenceBase::_F_inv
protectedinherited

The inverse deformation gradient.

Definition at line 158 of file LagrangianStressDivergenceBase.h.

◆ _F_ust

const MaterialProperty<RankTwoTensor>& LagrangianStressDivergenceBase::_F_ust
protectedinherited

The unmodified deformation gradient.

Definition at line 144 of file LagrangianStressDivergenceBase.h.

◆ _F_ust_det

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

◆ _F_ust_inv

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

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::LagrangianStressDivergenceBase().

◆ _F_ust_old

const MaterialProperty<RankTwoTensor>& LagrangianStressDivergenceBase::_F_ust_old
protectedinherited

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.

◆ _grad_phi_undisplaced

template<class G >
const VariablePhiGradient& UpdatedLagrangianStressDivergenceBase< G >::_grad_phi_undisplaced
protected

Definition at line 63 of file UpdatedLagrangianStressDivergence.h.

◆ _JxW_undisplaced

template<class G >
const MooseArray<Real>& UpdatedLagrangianStressDivergenceBase< G >::_JxW_undisplaced
protected

Definition at line 64 of file UpdatedLagrangianStressDivergence.h.

◆ _large_kinematics

bool LagrangianStressDivergenceBase::_large_kinematics
protectedinherited

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(), LagrangianStressDivergenceBase::deltaPK1NonLocalFBar(), and LagrangianStressDivergenceBase::initialSetup().

◆ _material_jacobian

template<class G >
const MaterialProperty<RankFourTensor>& UpdatedLagrangianStressDivergenceBase< G >::_material_jacobian
protected

Definition at line 58 of file UpdatedLagrangianStressDivergence.h.

◆ _ndisp

const unsigned int LagrangianStressDivergenceBase::_ndisp
protectedinherited

◆ _out_of_plane_strain

const MooseVariable* LagrangianStressDivergenceBase::_out_of_plane_strain
protectedinherited

◆ _q_point_undisplaced

template<class G >
const MooseArray<Point>& UpdatedLagrangianStressDivergenceBase< G >::_q_point_undisplaced
protected

Definition at line 66 of file UpdatedLagrangianStressDivergence.h.

◆ _stabilize_strain

const bool LagrangianStressDivergenceBase::_stabilize_strain
protectedinherited

◆ _stress

template<class G >
const MaterialProperty<RankTwoTensor>& UpdatedLagrangianStressDivergenceBase< G >::_stress
protected

The Cauchy stress.

Definition at line 54 of file UpdatedLagrangianStressDivergence.h.

◆ _temperature

const MooseVariable* LagrangianStressDivergenceBase::_temperature
protectedinherited

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

Definition at line 193 of file LagrangianStressDivergenceBase.h.

Referenced by LagrangianStressDivergenceBase::computeQpOffDiagJacobian().


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