18 params.
addRequiredParam<
unsigned int>(
"component",
"Which direction this kernel acts in");
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");
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`.");
38 params.
addParam<std::string>(
"base_name",
"Material property base name");
41 "The name of the temperature variable used in the " 42 "ComputeThermalExpansionEigenstrain. (Not required for " 43 "simulations without temperature coupling.)");
45 params.
addParam<std::vector<MaterialPropertyName>>(
48 "List of eigenstrains used in the strain calculation. Used for computing their derivatives " 49 "for off-diagonal Jacobian terms.");
52 "The out-of-plane strain variable for weak plane stress formulation.");
62 _large_kinematics(false),
63 _stabilize_strain(getParam<bool>(
"stabilize_strain")),
64 _F_bar_mode(getParam<
MooseEnum>(
"F_bar_mode") ==
"incremental" ?
FBarMode::Incremental
66 _base_name(isParamValid(
"base_name") ? getParam<
std::string>(
"base_name") +
"_" :
""),
67 _alpha(getParam<unsigned
int>(
"component")),
68 _ndisp(coupledComponents(
"displacements")),
70 _avg_grad_trial(_ndisp),
71 _avg_grad_spatial_phi(_ndisp),
72 _avg_test_phi_cross(3,
std::vector<
std::vector<
std::vector<
Real>>>(3)),
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")),
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")),
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)
96 for (
unsigned int i = 0; i <
_ndisp; i++)
100 auto order_x = getVar(
"displacements", 0)->order();
101 for (
unsigned int i = 1; i <
_ndisp; i++)
103 if (getVar(
"displacements", i)->order() != order_x)
104 mooseError(
"The Lagrangian StressDivergence kernels require equal " 105 "order interpolation for all displacements.");
109 const auto nvar = _coupled_moose_vars.size();
111 for (std::size_t i = 0; i < nvar; ++i)
112 for (
auto eigenstrain_name : getParam<std::vector<MaterialPropertyName>>(
"eigenstrain_names"))
114 eigenstrain_name, _coupled_moose_vars[i]->
name()));
120 if (!getParam<std::vector<MaterialPropertyName>>(
"eigenstrain_names").empty())
122 &getMaterialPropertyByName<RankFourTensor>(
_base_name +
"dcauchy_stress_d_eigenstrain");
129 _F_ust_inv = &getMaterialPropertyByName<RankTwoTensor>(
130 _base_name +
"inverse_unstabilized_deformation_gradient");
132 &getMaterialPropertyByName<Real>(
_base_name +
"det_unstabilized_deformation_gradient");
150 if (isParamSetByUser(
"large_kinematics") &&
152 paramError(
"large_kinematics",
153 "large_kinematics disagrees with the ComputeLagrangianStrain calculator (which " 156 " kinematics). large_kinematics is deprecated here; set it only on the strain " 168 _fe_problem.prepareShapes(_var.number(), _tid);
184 _fe_problem.prepareShapes(jvar, _tid);
203 const RankTwoTensor delta_sigma_nl = (*_d_nl_fbar)[_qp] * delta_F_avg;
206 return delta_sigma_nl;
const unsigned int _alpha
Which component of the vector residual this kernel is responsible for.
const MaterialProperty< Real > * _F_ust_det
virtual Real computeQpJacobianDisplacement(unsigned int alpha, unsigned int beta)=0
std::vector< std::vector< RankTwoTensor > > _avg_grad_trial
virtual void precalculateJacobianDisplacement(unsigned int component)=0
Prepare the average shape function gradients for stabilization.
virtual void precalculateOffDiagJacobian(unsigned int jvar) override
void mooseError(Args &&... args)
unsigned int number() const
LagrangianStressDivergenceBase(const InputParameters ¶meters)
const bool _stabilize_strain
If true calculate the deformation gradient derivatives for F_bar.
virtual Real computeQpJacobian() 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 th...
virtual Real computeQpJacobianOutOfPlaneStrain()=0
virtual void precalculateJacobian() override
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.
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
const MaterialProperty< RankFourTensor > * _dcauchy_stress_d_eigenstrain
Derivative of the Cauchy stress with respect to the eigenstrain (published by ComputeLagrangianObject...
const JvarMap & getJvarMap()
std::vector< unsigned int > _disp_nums
The displacement numbers.
FBarMode
Mirrors ComputeLagrangianStrainBase::FBarMode.
unsigned int mapJvarToCvar(unsigned int jvar)
static InputParameters validParams()
RankTwoTensorTempl< Real > transpose() const
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).
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const MooseVariable * _temperature
Temperature, if provided. This is used only to get the trial functions.
static InputParameters validParams()
IntRange< T > make_range(T beg, T end)
bool hasGuaranteedMaterialProperty(const MaterialPropertyName &prop, Guarantee guarantee)
bool _large_kinematics
If true use large deformation kinematics.
std::vector< std::vector< const MaterialProperty< RankTwoTensor > * > > _deigenstrain_dargs
Eigenstrain derivatives wrt generate coupleds.
Add-on class that provides the functionality to check if guarantees for material properties are provi...
const std::string _base_name
Prepend to the material properties.
void ErrorVector unsigned int
virtual void initialSetup() override
Derive _large_kinematics from the strain calculator's LARGE_KINEMATICS guarantee. ...
virtual Real computeQpJacobianTemperature(unsigned int cvar)=0