13 #include "MooseVariable.h"
14 #include "SystemBase.h"
15 #include "RankTwoTensor.h"
16 #include "NonlinearSystem.h"
17 #include "MooseMesh.h"
18 #include "ArbitraryQuadrature.h"
19 #include "DenseMatrix.h"
21 #include "libmesh/quadrature.h"
22 #include "libmesh/enum_quadrature_type.h"
23 #include "libmesh/string_to_enum.h"
30 params.addClassDescription(
"Quasi-static stress divergence kernel for Shell element");
31 params.addRequiredRangeCheckedParam<
unsigned int>(
34 "An integer corresponding to the degree of freedom "
35 "this kernel acts on. (0 for disp_x, "
36 "1 for disp_y, 2 for disp_z, 3 for rot_x, 4 for rot_y)");
37 params.addRequiredParam<std::string>(
"through_thickness_order",
38 "Quadrature order in out of plane direction");
39 params.addParam<
bool>(
"large_strain",
41 "Set to true to turn on finite strain calculations.");
42 params.set<
bool>(
"use_displaced_mesh") =
false;);
44 template <ComputeStage compute_stage>
46 : ADKernel<compute_stage>(parameters),
47 _component(getParam<unsigned int>(
"component")),
48 _large_strain(getParam<bool>(
"large_strain"))
50 _t_qrule = libmesh_make_unique<QGauss>(
51 1, Utility::string_to_enum<Order>(getParam<std::string>(
"through_thickness_order")));
61 for (
unsigned int i = 0; i <
_t_weights.size(); ++i)
63 _stress[i] = &getADMaterialProperty<RankTwoTensor>(
"stress_t_points_" + std::to_string(i));
65 &getMaterialPropertyOldByName<RankTwoTensor>(
"stress_t_points_" + std::to_string(i));
66 _B_mat[i] = &getADMaterialProperty<DenseMatrix<Real>>(
"B_t_points_" + std::to_string(i));
68 _B_nl[i] = &getADMaterialProperty<DenseMatrix<Real>>(
"B_nl_t_points_" + std::to_string(i));
70 _J_map[i] = &getADMaterialProperty<Real>(
"J_mapping_t_points_" + std::to_string(i));
74 template <ComputeStage compute_stage>
78 _q_weights = _qrule->get_weights();
79 ADReal residual = 0.0;
80 ADReal residual1 = 0.0;
81 for (_qp_z = 0; _qp_z < _t_weights.size(); ++_qp_z)
83 residual1 = (*_stress[_qp_z])[_qp](0, 0) * (*_B_mat[_qp_z])[_qp](0, _i + _component * 4) +
84 (*_stress[_qp_z])[_qp](1, 1) * (*_B_mat[_qp_z])[_qp](1, _i + _component * 4) +
85 2.0 * (*_stress[_qp_z])[_qp](0, 1) * (*_B_mat[_qp_z])[_qp](2, _i + _component * 4) +
86 2.0 * (*_stress[_qp_z])[_qp](0, 2) * (*_B_mat[_qp_z])[_qp](3, _i + _component * 4) +
87 2.0 * (*_stress[_qp_z])[_qp](1, 2) * (*_B_mat[_qp_z])[_qp](4, _i + _component * 4);
91 ((*_stress_old[_qp_z])[_qp](0, 0) * (*_B_nl[_qp_z])[_qp](0, _i + _component * 4) +
92 (*_stress_old[_qp_z])[_qp](1, 1) * (*_B_nl[_qp_z])[_qp](1, _i + _component * 4) +
93 2.0 * (*_stress_old[_qp_z])[_qp](0, 1) * (*_B_nl[_qp_z])[_qp](2, _i + _component * 4) +
94 2.0 * (*_stress_old[_qp_z])[_qp](0, 2) * (*_B_nl[_qp_z])[_qp](3, _i + _component * 4) +
95 2.0 * (*_stress_old[_qp_z])[_qp](1, 2) * (*_B_nl[_qp_z])[_qp](4, _i + _component * 4));
97 residual += residual1 * (*_J_map[_qp_z])[_qp] * _q_weights[_qp] * _t_weights[_qp_z] /
98 (_ad_JxW[_qp] * _ad_coord[_qp]);