12 #include "libmesh/quadrature.h"
16 template <ComputeStage compute_stage>
21 params.addClassDescription(
"Compute strain increment for incremental strains in 2D geometries.");
23 MooseEnum outOfPlaneDirection(
"x y z",
"z");
24 params.addParam<MooseEnum>(
25 "out_of_plane_direction", outOfPlaneDirection,
"The direction of the out-of-plane strain.");
29 template <ComputeStage compute_stage>
31 const InputParameters & parameters)
33 _out_of_plane_direction(getParam<MooseEnum>(
"out_of_plane_direction"))
37 template <ComputeStage compute_stage>
41 for (
unsigned int i = 0; i < 3; ++i)
43 if (_out_of_plane_direction == i)
45 _disp[i] = &adZeroValue();
46 _grad_disp[i] = &adZeroGradient();
50 _disp[i] = &adCoupledValue(
"displacements", i);
51 _grad_disp[i] = &adCoupledGradient(
"displacements", i);
54 if (_fe_problem.isTransient() && i != _out_of_plane_direction)
55 _grad_disp_old[i] = &coupledGradientOld(
"displacements", i);
57 _grad_disp_old[i] = &_grad_zero;
61 template <ComputeStage compute_stage>
64 ADRankTwoTensor & total_strain_increment)
68 (*_grad_disp[0])[_qp], (*_grad_disp[1])[_qp], (*_grad_disp[2])[_qp]);
70 (*_grad_disp_old[1])[_qp],
71 (*_grad_disp_old[2])[_qp]);
75 A(_out_of_plane_direction, _out_of_plane_direction) = computeOutOfPlaneGradDisp();
76 Fbar(_out_of_plane_direction, _out_of_plane_direction) = computeOutOfPlaneGradDispOld();
80 total_strain_increment = 0.5 * (A + A.transpose());
83 template <ComputeStage compute_stage>
87 if (_out_of_plane_direction != 2 && _ndisp != 3)
88 mooseError(
"For 2D simulations where the out-of-plane direction is x or y the number of "
89 "supplied displacements must be three.");
90 else if (_out_of_plane_direction == 2 && _ndisp != 2)
91 mooseError(
"For 2D simulations where the out-of-plane direction is z the number of supplied "
92 "displacements must be two.");